radio faction problem
#1

i have problem with radio faction, if im compile no prolem but in game massage cannot show to faction member this my code
PHP код:
CMD:radio(playeridparams[])
{
    new 
string[128], text[128], ctext[60], pname[MAX_PLAYER_NAME+1];
    
GetPlayerName(playeridpnamesizeof(pname));
    if(
sscanf(params"s[128]"text)) return SendClientMessage(playerid0x46E850FF"SERVER:{FFFFFF} /r(adio) [text]");
    if(
PlayerInfo[playerid][pFaction] == 1)
    {
        if(
PlayerData[playerid][pFacrank] == 1){ ctext "Cadet"; }
        if(
PlayerData[playerid][pFacrank] == 2){ ctext "Officer"; }
        if(
PlayerData[playerid][pFacrank] == 3){ ctext "Senior Officer"; }
        if(
PlayerData[playerid][pFacrank] == 4){ ctext "Corporal"; }
        if(
PlayerData[playerid][pFacrank] == 5){ ctext "Sergeant"; }
        if(
PlayerData[playerid][pFacrank] == 6){ ctext "Lieutenant"; }
        if(
PlayerData[playerid][pFacrank] == 7){ ctext "Captain"; }
        if(
PlayerData[playerid][pFacrank] == 8){ ctext "Commander"; }
        if(
PlayerData[playerid][pFacrank] == 9){ ctext "Deputy Chief"; }
        if(
PlayerData[playerid][pFacrank] == 10){ ctext "Jendral"; }
        
format(stringsizeof(string), "%s %s: %s"ctextpnametext);
        if(
PlayerData[playerid][pFaction] > 0)
        {
            
SendCopMessage(COLOR_PDRADstring);
        }
 return 
1;
    } 
and this stock for SendCopMessage
PHP код:
stock SendCopMessage(colstring[])
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
PlayerData[i][pFaction] == 1)
            
SendClientMessage(icolstring);     
    return 
1;

where is my mistake??
sory for my bad english
Reply
#2

Try to change your if condition in SendCopMessage to this:
PHP код:
stock SendCopMessage(colstring[]) 

    for(new 
0MAX_PLAYERSi++) 
    { 
        if(
PlayerInfo[i][pFaction] == 1
            
SendClientMessage(icolstring);      
    }
    return 
1

Reply
#3

I fix themselves,
Quote:

if(PlayerInfo[playerid][pFaction] == 1)

just change to
Quote:

if(PlayerData[playerid][pFaction] == 1)

im forget declaration for pFaction change to PlayerData hehe


BTW thank for your help dude
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)