SA-MP Forums Archive
[SOLVED]Script crashing my 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: [SOLVED]Script crashing my server?! (/showthread.php?tid=249383)



[SOLVED]Script crashing my server?! - Seven_of_Nine - 18.04.2011

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.


Re: Script crashing my server?! - Sascha - 18.04.2011

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



Re: Script crashing my server?! - Seven_of_Nine - 18.04.2011

OH HELL! XD
Thanks I forgot it.