SA-MP Forums Archive
How I do this? - 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: How I do this? (/showthread.php?tid=222875)



How I do this? - YossiBz - 08.02.2011

here screenshot

tnx for helper


Re: How I do this? - [03]Garsino - 08.02.2011

https://sampwiki.blast.hk/wiki/Format


Re: How I do this? - YossiBz - 08.02.2011

but how?
here is my code
PHP код:
    if(!strcmp(cmd,"/id",true)){
    if(
playerid => && playerid <10) return format(string,sizeof(string),"00%d",playerid),SendClientMessage(playerid,COLOR_RED,string);
    if(
playerid =>10 && playerid <100) return format(string,sizeof(string),"0%d",playerid),SendClientMessage(playerid,COLOR_RED,string);
     if(
playerid =>100) return format(string,sizeof(string),"%d",playerid),SendClientMessage(playerid,COLOR_RED,string);
    return 
1;
    } 



Re: How I do this? - [03]Garsino - 08.02.2011

pawn Код:
if(!strcmp(cmd, "/id", true))
{
    format(string, sizeof(string), "%03d", playerid);
    SendClientMessage(playerid, COLOR_RED, string);
    return 1;
}



Re: How I do this? - YossiBz - 08.02.2011

tnx!


Re: How I do this? - [03]Garsino - 08.02.2011

Quote:
Originally Posted by YossiBz
Посмотреть сообщение
tnx!
I just realized that there was no need for the switch statement there. So I edited my post with the "fixed" code.