SA-MP Forums Archive
String error or something? - 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: String error or something? (/showthread.php?tid=276638)



String error or something? - Jmarr - 14.08.2011

Hello,

I've made this script, that echos what a players plate number is, the number is saved in their user file under pPlate or Plate. But when I do the command it is supposed to say 'Your plate number is 123456. Type /changeplate [8 chars] to change it." Instead it says "Your plate number is @. Type /changeplate [8 chars] to change it." I'm not sure if I should replace %s with something or what, help!

Code
pawn Код:
if(strcmp(cmd, "/plate", true) == 0)
    {
    new string[128];
    format(string, sizeof(string), "Your plate number is %s. Type /changeplate [8 chars] to change it.", PlayerInfo[playerid][pPlate]);
    SendClientMessage(playerid, COLOR_SYSTEM, string);
    return 1;
}



AW: String error or something? - Drebin - 14.08.2011

pawn Код:
if(strcmp(cmd, "/plate", true) == 0)
    {
    new string[128];
    format(string, sizeof(string), "Your plate number is %d. Type /changeplate [8 chars] to change it.", PlayerInfo[playerid][pPlate]);
    SendClientMessage(playerid, COLOR_SYSTEM, string);
    return 1;
}
Try that.
Changed %s to %d


Re: String error or something? - Darnell - 14.08.2011

Can I have the /changeplate ? .


Re: String error or something? - Jmarr - 14.08.2011

Works Drebin, thanks.

Darnell: I haven't coded that part yet, sorry. When I do I'll send you a PM though.