[+REP]Server restarting randomly and bug
#2

When you make a new variable, you need to assign it a value.

pawn Код:
new name[24];
GetPlayerName(playerid, name, sizeof name);
Just because you make a new command doesn't mean it will have all the parameters set.

__________________________________________________ ____________________________

I highly recommend zcmd. It's fast and easy to use:

https://sampforum.blast.hk/showthread.php?tid=91354

Here's an example:

pawn Код:
CMD:kill(playerid, params[])
{
    new pname[24];
    GetPlayerName(playerid, pname, 24);
    SendClientMessage(playerid, 0xEE82EEFF, "You have killed yourself using /kill and have lost: $400.");
    SendClientMessageToAll(0xEE82EEFF, "%s has Killed them self using /kill. Reason: %s",pname,params);
    SetPlayerHealth(playerid, 0);
    return 1;
}
You don't have to keep adding it in OnPlayerCommandText, WAY fast than zcmd, has params, etc.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: