Command sometimes crashing server - 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: Command sometimes crashing server (
/showthread.php?tid=75021)
Command sometimes crashing server -
Robbin237 - 28.04.2009
Hi guys, my server crashes sometimes, and sometimes not when using the command /a or /b
these are the codes
pawn Код:
dcmd_a(playerid,params[])
{
new Float:X, Float:Y, Float:Z;
GetObjectPos(Object[playerid], X, Y, Z);
SetObjectPos(Object[playerid], X, Y, Z+0.25);
return 1;
}
pawn Код:
dcmd_b(playerid,params[])
{
new Float:X, Float:Y, Float:Z;
GetObjectPos(Object[playerid], X, Y, Z);
SetObjectPos(Object[playerid], X, Y, Z-0.25);
return 1;
}
Heres the Object[playerid]:
pawn Код:
ObjectID[playerid] = strval(params);
Object[playerid] = CreateObject(ObjectID[playerid], X, Y, Z, 0, 0, 0);
Does anybody know why it crashes my server? No client crash but server crash, sometimes it works
sometimes not.
Thnx!
Re: Command sometimes crashing server -
ferriswheel - 28.04.2009
If for some reason Object[playerid] is not a valid object and you run it, the game will crash.