Pen1 Edit, command failure. - 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: Pen1 Edit, command failure. (
/showthread.php?tid=91128)
Pen1 Edit, command failure. -
Mr. M - 12.08.2009
Okay, so I'm editing the Public Enemy No. 1 script, but the /veh command crashes me

Here's the command;
pawn Код:
if (strcmp(cmd, "/veh", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [vehicleid]");
return 1;
}
if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 1337)
{
new weaponid = strval(tmp);
new Float:px, Float:py, Float:pz, Float:pa;
GetPlayerFacingAngle(playerid,pa);
GetPlayerPos(playerid, px, py, pz);
new coordsstring[256];
format(coordsstring, 256, "CreateVehicle(%d, %.1f,%.1f,%.1f,%.1f,-1,-1,-1);\n", weaponid, px, py, pz ,pa);
printf("AdmCmd:veh: %d was spawned", weaponid);
CreateVehicle(weaponid, px, py, pz, pa,-1,-1,10000);
new File:hFile;
hFile = fopen("coords.txt", io_append);
fwrite(hFile, coordsstring);
fclose(hFile);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}
Compiling goes fine, but if I try to spawn a car ingame, I crash.
Help would be highly appreciated!
Re: Pen1 Edit, command failure. -
Adil - 12.08.2009
Uh, Wrong Section ?
Re: Pen1 Edit, command failure. -
Memoryz - 12.08.2009
This isn't the wrong section >.<
Did you change anything to this command recently?
Or, you probably spawned an invalid model ID.
Re: Pen1 Edit, command failure. -
Mr. M - 13.08.2009
Quote:
|
Originally Posted by Memoryz
This isn't the wrong section >.<
Did you change anything to this command recently?
Or, you probably spawned an invalid model ID.
|
I haven't changed anything in the script.
I just compiled it to be sure, that went fine, so I started up my local server, got in to test everything and the /veh makes me crash.
I tried multiple model ID's but I still crash.