SA-MP Forums Archive
Why is this 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)
+--- Thread: Why is this crashing my server? (/showthread.php?tid=406870)



Why is this crashing my server? - hydravink - 11.01.2013

Hey,

I just made this command and it crashes my server... What's wrong??

pawn Код:
CMD:ashout(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] > 1)
    {
        new string[256];
       
        if(sscanf(params, "s[256]", string)) return
            SendClientMessage(playerid, COLOR_ORANGE, "[USAGE]{FFFFFF} /ashout <text>");
       
        format(string, sizeof(string), "~w~%s", string);
        GameTextForAll(string, 5000, 3);
    }else{
        SendClientMessage(playerid, COLOR_ERROR, "[ERROR]{FFFFFF} Only level 2,3,4,5 admins can use this command.");
    }
    return 1;
}



Re: Why is this crashing my server? - park4bmx - 11.01.2013

Are you sure ?
Nothing seems wrong, I would say put some "printf"'s (debugging)


Re: Why is this crashing my server? - hydravink - 11.01.2013

I noticed it crashes when I use colors... Why?


Re: Why is this crashing my server? - park4bmx - 11.01.2013

Invalid placement of "~" would cause a crash or of an invalid colour.
But in that code doesn't seem the case


Re: Why is this crashing my server? - kaisersouse - 11.01.2013

Try making the string 128. 256 is too damned big.


Re: Why is this crashing my server? - hydravink - 11.01.2013

Okay, this was the strangest thing in my life.
Replacing ~w~%s with ~w~ %s works. Really? ...
This was funny, also, I guess it's solved :\ xD


Re: Why is this crashing my server? - martin3644 - 11.01.2013

OOPS. Didnt see that you posted, you have solved this problem

//DELETE


Re: Why is this crashing my server? - park4bmx - 11.01.2013

For the above post,
This is a "GameText" type it doesn't support these kind of colours!