Add pickups command? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Add pickups command? (
/showthread.php?tid=64342)
Add pickups command? -
javind0 - 03.02.2009
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?
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;
}
Re: Add pickups command? -
Onyx09 - 02.02.2010
Код:
new File: file = fopen(missionname, io_read);
try that isntead to read the file