03.02.2009, 14:08
Hey,
I was just wondering, is there any way to add pickups from a .cfg file?
EG:
1: IG admin/rcon admin can do /createpickup [pickupid]
2: It saves to /scriptfiles/pickups.cfg
3: On server restart/gmx pickups from pickups.cfg are loaded.
??
EDIT:
Why doesn't this work?
I was just wondering, is there any way to add pickups from a .cfg file?
EG:
1: IG admin/rcon admin can do /createpickup [pickupid]
2: It saves to /scriptfiles/pickups.cfg
3: On server restart/gmx pickups from pickups.cfg are loaded.
??
EDIT:
Why doesn't this work?
pawn Код:
if (strcmp(cmdtext, "/apu", true)==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 1337)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /houseo [housenumber]");
return 1;
}
new Float:pix;
new Float:piy;
new Float:piz;
GetPlayerPos(playerid, pix, piy, piz);
new File:pos=fopen("pickups.txt", io_append);
format(string, 256, "AddStaticPickup(%d,2, %f, %f, %f);", tmp, pix, piy, piz);
fwrite(pos, string);
fclose(pos);
SendClientMessage(playerid, COLOR_GREEN, string);
}
}
return 1;
}