21.07.2013, 03:03
Hello, I'm trying to make a medic radio message. I copied some codes from my police radio codes.
First, this is my police radio message command/script (Sorry for the indentation >_<)
This is my medic radio message (based on my police radio message script)
I compiled, then the pawno stopped working? Is there any problems with the command?
First, this is my police radio message command/script (Sorry for the indentation >_<)
Quote:
Код:
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[255]; 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); } } } return 1; } |
Quote:
Код:
if (strcmp("/mm", 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] == Medic) SendClientMessage(playerid,COLOR_ROYALBLUE,"You are not a Medic!"); } if(strlen(cmdtext) <= 4) { SendClientMessage(playerid,COLOR_ERROR,"USAGE: /mm [Medic Message]"); return 1; } else{ new output[255]; new pname[24]; GetPlayerName(playerid, pname, 24); strmid(output,cmdtext,3,strlen(cmdtext)); format(string, sizeof(string), "[MEDIC RADIO] - %s (%d): %s",pname,playerid,output); printf("%s", string); for(new i=0;i<MAX_PLAYERS;i++) { if(gTeam[i] == Medic) format(string, sizeof(string), "[MEDIC RADIO] - %s (%d): %s",pname,playerid,output); SendClientMessage(i,COLOR_ROYALBLUE,string); } } } return 1; } |