SA-MP Forums Archive
sendclientmessage help. - 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: sendclientmessage help. (/showthread.php?tid=310434)



sendclientmessage help. - the.et - 12.01.2012

hi ,
i need some advice on how am i going to do this.


The AdminLevel[playerid] is set to 3 , i want to display it out using the SendCleintMessage of the word 3. But this crashes the server everytime i try it , is there something wrong with it?


Код:
CMD:checkadmin(playerid, params[])
{

   if(AdminLevel[playerid] > 0) SendClientMessage(playerid, 0xFFFFFFF, "you are an admin! Level: %s" , AdminLevel[playerid]);
   return 1;
}
Thanks


Re: sendclientmessage help. - HyperZ - 12.01.2012

pawn Код:
CMD:checkadmin(playerid, params[])
{
    new string[64];
    format(string,sizeof(string),"you are an admin! Level: %d",AdminLevel[playerid]);
    if(AdminLevel[playerid] > 0) SendClientMessage(playerid,0xFFFFFFAA,string);
    return 1;
}



Re: sendclientmessage help. - ScriptJorkis - 12.01.2012

your doing it wrong

pawn Код:
new string[128],pname[MAX_PLAYER_NAME];
format(string,sizeof(string), "you are an admin! Level: %s", AdminLevel[playerid]
SendClientMessage(playerid, 0xFFFFFFF, string);
EDIT: HyperZ is fast


Re: sendclientmessage help. - [Diablo] - 12.01.2012

you need to format the string prior to using it.

pawn Код:
CMD:checkadmin(playerid, params[])
{
   new
        string[50];
   format(string, sizeof(string), "you are an admin! Level: %s", AdminLevel[playerid]); //
   if(AdminLevel[playerid] > 0) SendClientMessage(playerid, 0xFFFFFFF, string);
   return 1;
}
edit: too slow


Re: sendclientmessage help. - the.et - 12.01.2012

thankss


Re: sendclientmessage help. - HyperZ - 12.01.2012

Quote:
Originally Posted by the.et
Посмотреть сообщение
thankss
You're Welcome.