Command sometimes crashing server
#1

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!
Reply
#2

If for some reason Object[playerid] is not a valid object and you run it, the game will crash.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)