[SOLVED]Script crashing my server?!
#1

Hi all!

I was testing my new /jetpack command and when I typed /jetpack 0 then I heard the sound my samp-server.exe file has closed.

Why the hell?

/jetpack (zcmd):
pawn Код:
COMMAND:jetpack(playerid,params[]) {
    new
        name1[30],
        name2[30],
        id,
        text[128];
    if(PlayerInfo[playerid][pAdminLevel] >= 4) {
        if(sscanf(params,"u",id))
            return SendClientMessage(playerid,red,"USAGE: /jetpack [id]");
        if(IsPlayerConnected(id)) {
            GetPlayerName(playerid,name1,sizeof(name1));
            GetPlayerName(id,name2,sizeof(name2));
            format(text,sizeof(text),"Administrator \"%s\" has given \"%s\" a jetpack.");
            SendClientMessageToAll(medblue,text);
            SetPlayerSpecialAction(id, 2);
            SaveIn("jetpack",text);
        } else {
            return SendClientMessage(playerid,red,"Invalid ID");
        }
    } else {
        return SendClientMessage(playerid,red,"Only lvl4 or higher admins can use this command!");
    }
    return 1;
}
do not rewrite the code or suggest a better.
Reply
#2

pawn Код:
format(text,sizeof(text),"Administrator \"%s\" has given \"%s\" a jetpack.", name1, name2); //you forgot to add name1 and name2
Reply
#3

OH HELL! XD
Thanks I forgot it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)