Why is this crashing my server?
#1

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;
}
Reply
#2

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

I noticed it crashes when I use colors... Why?
Reply
#4

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

Try making the string 128. 256 is too damned big.
Reply
#6

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

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

//DELETE
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)