Cop Message Radio - text label
#4

You should put that code outside the loop.
pawn Код:
if(strcmp("/cm", cmdtext, true, 3) == 0)
{
new string[128];
if(IsSpawned[playerid] == 0) {
    SendClientMessage(playerid, COLOR_ERROR, "You are dead. You cannot use this command");
    return 1;
}
if(gTeam[playerid] != COP && gTeam[playerid] != SWAT && gTeam[playerid] != ARMY && gTeam[playerid] != FBI) {
    SendClientMessage(playerid,COLOR_ROYALBLUE,"You are not a Police Officer!");
}
if(strlen(cmdtext) <= 4) {
    SendClientMessage(playerid,COLOR_ERROR,"USAGE: /cm [Message]");
    return 1;
}
else{
    new output[128];
    new pname[24];
    GetPlayerName(playerid, pname, 24);
    strmid(output,cmdtext,3,strlen(cmdtext));
    format(string, sizeof(string), "[COP RADIO] - %s (%d): %s",pname,playerid,output);
    printf("%s", string);
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(gTeam[i] == COP || gTeam[i] == SWAT || gTeam[i] == ARMY || gTeam[i] == FBI) {
        format(string, sizeof(string), "[COP RADIO] - %s (%d): %s",pname,playerid,output);
        SendClientMessage(i,COLOR_ROYALBLUE,string);
        }
    }
        format(string, sizeof(output), "(radio) %s", output); //params to output
        SetPlayerChatBubble(playerid,output,COLOR_WHITE,5.0,5000);
}
return 1;
}
About the param error:
Replace params with output
Reply


Messages In This Thread
Cop Message Radio - text label - by Uberanwar - 31.08.2013, 10:42
Re: Cop Message Radio - text label - by QuaTTrO - 31.08.2013, 10:48
Re: Cop Message Radio - text label - by Uberanwar - 31.08.2013, 10:50
Re: Cop Message Radio - text label - by QuaTTrO - 31.08.2013, 10:54
Re: Cop Message Radio - text label - by Uberanwar - 01.09.2013, 05:36

Forum Jump:


Users browsing this thread: 2 Guest(s)