Roleplay radio ( how to display the rank )
#1

If a player is
pawn Код:
PlayerInfo[playerid][FD1] = 1
I want it to display the "rank" of the player to all other online
pawn Код:
[FD] = 1;
players, And the rank will be displayed before the name of the player.

FD1 = Fire Department

pawn Код:
COMMAND:r(playerid, params[])
{
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][FD1] = 1) // is this correct?
                {
                    SendClientMessage(i, [Fire Department]John_Johnson: "MESSAGE" // we have to use a string i think? I need help with this guys. To get the name of the player, and the message he wants to send, and the message will be sendt to all online FD = 1 players, right?
                }
            }
 }
    return 1;
}
Reply
#2

You get an error?
Reply
#3

Okay first all you dont need IsPlayerConnected as it will only send a message to people online in the FD anyway.
But i fixed your code a bit, it will work how you want it.

Код:
COMMAND:r(playerid, params[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][FD1] == 1) // is this correct?
        {
            SendClientMessage(i, [Fire Department]John_Johnson: "This is the message that will be sent to all members in the fire dept.");
   	    }
    }
    return 1;
}
Reply
#4

pawn Код:
COMMAND:r(playerid, params[])
{
new MSG[126];
if(sscanf(params, "s", MSG)) return 0;
new pNamer[MAX_PLAYER_NAME];GetPlayerName(playerid,pNamer,sizeof pNamer);
new Str[126];format(Str,sizeof Str,"[Fire Department]%s: %s"pNamer,MSG);
for(new i = 0; i < MAX_PLAYERS; i++)
     {
         if(IsPlayerConnected(i) && PlayerInfo[i][FD1]==1) SendClientMessage(i,-1,Str);
     }
return 1;
}
I done this wih m phone so, Yh..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)