sendclientmessage help.
#1

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

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

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

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

thankss
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)