üdv,unatkoztam,nézelõdtem,de sehol se találtam ilyet(nem nagyon néztem,ez a nagy igazság
)
ma a suliba gondolkoztam,hogy derék raktam fel magamtól egy fs-t gm-et,ezért kitaláltam csinálok egy ilyet,de csak béta verzióba müködik,IG lehet lerakni mapicont
Használata:
/mapicon [Tipus]
/deletemapicon[iD]
#include <a_samp>
#include <streamer>
#include <zcmd>
#include <sscanf2>
#define MAXIMUM_MAP_ICONOK 20 // Maximális lerakható mapicon
enum Map_Info
{
ID,
Typus,
Float:X,
Float:Y,
Float:Z
}
new MapIconInfo[MAXIMUM_MAP_ICONOK][Map_Info];
stock SaveMapIcons()
{
new idx = 0, File:file;
new string[256];
while(idx < MAXIMUM_MAP_ICONOK)
{
format(string, sizeof(string), \"%d|%f|%f|%f\\r\\n\",
MapIconInfo[idx][Typus],
MapIconInfo[idx][X],
MapIconInfo[idx][Y],
MapIconInfo[idx][Z]);
if(idx == 0)
{
file = fopen(\"mapicon.txt\", io_write);
}
else
{
file = fopen(\"mapicon.txt\", io_append);
}
fwrite(file, string);
fclose(file);
idx++;
}
print(\"Mapiconok sikeresen elmentve.\");
}
stock LoadMapIcons()
{
new idx = 0;
new dinfo[4][128];
new string[256];
new File:file = fopen(\"mapicon.txt\", io_read);
if(file)
{
while(idx < MAXIMUM_MAP_ICONOK)
{
fread(file, string);
MapIconInfo[idx][Typus] = strval(dinfo[0]);
MapIconInfo[idx][X] = floatstr(dinfo[1]);
MapIconInfo[idx][Y] = floatstr(dinfo[2]);
MapIconInfo[idx][Z] = floatstr(dinfo[3]);
if(MapIconInfo[idx][Typus])
{
printf(\"MapiconID:%d,X:%d,Y:%d,Z:d,Typus:%d\",idx,MapIconInfo[idx][X],MapIconInfo[idx][Y],MapIconInfo[idx][Z],MapIconInfo[idx][Typus]);
MapIconInfo[idx][iD] = CreateDynamicMapIcon(MapIconInfo[idx][X], MapIconInfo[idx][Y], MapIconInfo[idx][Z], MapIconInfo[idx][Typus], 0 ,0);
}
idx++;
}
}
return 1;
}
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Shadee IG create mapicon\");
print(\"--------------------------------------\\n\");
LoadMapIcons();
return 1;
}
public OnFilterScriptExit()
{
SaveMapIcons();
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
CMD:mapicon(playerid,params[])
{
new tipusa,string[128];
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,-1,\"Nem vagy jogosult a parancs használatára!\");
if(sscanf(params,\"i\",tipusa))return SendClientMessage(playerid,-1,\"Használat:/mapicon [Tipus]\");
if(tipusa > 36)return SendClientMessage(playerid,-1,\"A Tipusa maximum 36 lehet!\");
for(new idx=0; idx<MAXIMUM_MAP_ICONOK; idx++)
{
if(!MapIconInfo[idx][Typus])
{
MapIconInfo[idx][Typus] = tipusa;
GetPlayerPos(playerid, MapIconInfo[idx][X], MapIconInfo[idx][Y], MapIconInfo[idx][Z]);
MapIconInfo[idx][Typus] = CreateDynamicMapIcon(MapIconInfo[idx][X], MapIconInfo[idx][Y], MapIconInfo[idx][Z], MapIconInfo[idx][Typus], 0 ,0);
SaveMapIcons();
format(string,sizeof(string),\"%s lerakott egy mapicont!\",Neve(playerid));
print(string);
}
}
return 1;
}
CMD:deletemapicon(playerid,params[])
{
new idx;
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,-1,\"Nem vagy jogosult a parancs használatára!\");
if(sscanf(params,\"i\",idx))return SendClientMessage(playerid,-1,\"Használat:/deletemapicon [mapiconID]\");
if(!MapIconInfo[idx][iD])return SendClientMessage(playerid,-1,\"Nincs ilyen IDjû mapicon!\");
MapIconInfo[idx][iD] = 0;
MapIconInfo[idx][X] = 0;
MapIconInfo[idx][Y] = 0;
MapIconInfo[idx][Z] = 0;
return 1;
}
stock Neve(playerid)
{
new Nev[MAX_PLAYER_NAME];
GetPlayerName(playerid,Nev,sizeof(Nev));
return Nev;
}
#include <a_samp>
#include <streamer>
#include <zcmd>
#include <sscanf2>
#define MAXIMUM_MAP_ICONOK 20 // Maximumális lerakható mapicon
enum Map_Info
{
ID,
Typus,
Float:X,
Float:Y,
Float:Z
}
new MapIconInfo[MAXIMUM_MAP_ICONOK][Map_Info];
stock SaveMapIcons()
{
new idx = 0, File:file;
new string[256];
while(idx < MAXIMUM_MAP_ICONOK)
{
format(string, sizeof(string), \"%d|%f|%f|%f\\r\\n\",
MapIconInfo[idx][Typus],
MapIconInfo[idx][X],
MapIconInfo[idx][Y],
MapIconInfo[idx][Z]);
if(idx == 0)
{
file = fopen(\"mapicon.txt\", io_write);
}
else
{
file = fopen(\"mapicon.txt\", io_append);
}
fwrite(file, string);
fclose(file);
idx++;
}
print(\"Mapiconok sikeresen elmentve.\");
}
stock LoadMapIcons()
{
new idx = 0;
new dinfo[4][128];
new string[256];
new File:file = fopen(\"mapicon.txt\", io_read);
if(file)
{
while(idx < MAXIMUM_MAP_ICONOK)
{
fread(file, string);
MapIconInfo[idx][Typus] = strval(dinfo[0]);
MapIconInfo[idx][X] = floatstr(dinfo[1]);
MapIconInfo[idx][Y] = floatstr(dinfo[2]);
MapIconInfo[idx][Z] = floatstr(dinfo[3]);
if(MapIconInfo[idx][Typus])
{
printf(\"MapiconID:%d,X:%d,Y:%d,Z:d,Typus:%d\",idx,MapIconInfo[idx][X],MapIconInfo[idx][Y],MapIconInfo[idx][Z],MapIconInfo[idx][Typus]);
MapIconInfo[idx][iD] = CreateDynamicMapIcon(MapIconInfo[idx][X], MapIconInfo[idx][Y], MapIconInfo[idx][Z], MapIconInfo[idx][Typus], 0 ,0);
}
idx++;
}
}
return 1;
}
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Shadee IG create mapicon\");
print(\"--------------------------------------\\n\");
LoadMapIcons();
return 1;
}
public OnFilterScriptExit()
{
SaveMapIcons();
return 1;
}
CMD:mapicon(playerid,params[])
{
new tipusa;
if(sscanf(params,\"i\",tipusa))return SendClientMessage(playerid,-1,\"Használat:/mapicon [Tipus]\");
for(new idx=0; idx<MAXIMUM_MAP_ICONOK; idx++)
{
if(!MapIconInfo[idx][Typus])
{
MapIconInfo[idx][Typus] = tipusa;
GetPlayerPos(playerid, MapIconInfo[idx][X], MapIconInfo[idx][Y], MapIconInfo[idx][Z]);
MapIconInfo[idx][Typus] = CreateDynamicMapIcon(MapIconInfo[idx][X], MapIconInfo[idx][Y], MapIconInfo[idx][Z], MapIconInfo[idx][Typus], 0 ,0);
SaveMapIcons();
}
}
return 1;
}
Ötleteket várok!