SA-MP Forums Archive
This message doesn't show - 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: This message doesn't show (/showthread.php?tid=313928)



This message doesn't show - Face9000 - 27.01.2012

pawn Код:
for(new i=0;i<MAX_PLAYERS;i++)
    {
    new current_zone;
    current_zone = player_zone[i];
    if(gTeam[playerid] == TEAM_COP)
    {
    new copmsg[170];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(copmsg, sizeof(copmsg), "- WARNING ALL COPS: Robbery in progress by %s (%d) - Location: %s",name,playerid,zones[current_zone][zone_name]);
    SendClientMessage(i, COLOR_BLUE, copmsg);
    }
    }
When a player start a robbery,this "WARNING ALL COPS etc" message doesn't show to TEAM_COP.

I got NO errors while compiling.


Re: This message doesn't show - park4bmx - 27.01.2012

Your looping thought all player with the letter "I" then Why do you then use "playerid" ?


Re: This message doesn't show - Face9000 - 27.01.2012

Is a simple code mistake i made,however this don't fix the problem.


Re: This message doesn't show - Scenario - 27.01.2012

I would suggest using some prints to debug the problem.


Re: This message doesn't show - Face9000 - 28.01.2012

It prints this:

[02:12:04] - WARNING ALL COPS: Axel(1) murdered Floy(0) at Downtown

I used:
pawn Код:
printf("%s", copmsg);



Re: This message doesn't show - Scenario - 28.01.2012

Make sure your if statements are going through too. It's a good idea to print the team's each player is on and make sure it's all matching the statements properly.


Re: This message doesn't show - jamesbond007 - 28.01.2012

pawn Код:
for(new i=0;i<MAX_PLAYERS;i++)
    {
    if(!IsPlayerConnected(i))continue;
    new current_zone;
    current_zone = player_zone[i];
    if(gTeam[i] == TEAM_COP)
    {
    new copmsg[170];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(copmsg, sizeof(copmsg), "- WARNING ALL COPS: Robbery in progress by %s (%d) - Location: %s",name,playerid,zones[current_zone][zone_name]);
    SendClientMessage(i, COLOR_BLUE, copmsg);
    }
    }