17.08.2013, 10:59
pawn Код:
dcmd_suspect(playerid,params[])
{
new string[128];
new ID;
new cmdreason[128];
if(sscanf(params, "us[100]", ID, cmdreason))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /suspect (Player Name/ID) (Reason)");
return 1;
}
if(IsSpawned[playerid] != 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
return 1;
}
if(gTeam[playerid] != COP && gTeam[playerid] != SWAT && gTeam[playerid] != FBI && gTeam[playerid] != ARMY)
{
SendClientMessage(playerid,COLOR_ERROR,"Only law enforcement can report criminals on the police radio.");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot report them",ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(gTeam[ID] == COP|| gTeam[ID] == SWAT || gTeam[ID] == FBI || gTeam[ID] == ARMY)
{
SendClientMessage(playerid,COLOR_ERROR,"You cannot report other law enforcement on the police radio. Im sure they done nothing wrong.");
return 1;
}
if(playerid == ID)
{
SendClientMessage(playerid,COLOR_ERROR,"You cannot report yourself down the police radio. Why would you even want to do that.");
return 1;
}
new message =strval(cmdreason);
new copmsg[250];
format(string,sizeof(string),"[POLICE RADIO] Law Enforcement Officer %s(%d) has reported %s(%d) for criminal activity. Reason: %s",PlayerName(playerid),playerid,PlayerName(ID),ID,message);
SendRadioMessageToCops(copmsg);
format(string,sizeof(string),"[POLICE ACTION] Law Enforcement Officer %s(%d) has reported you. Reason: %s",PlayerName(playerid),playerid,message);
SendClientMessage(ID,COLOR_ROYALBLUE,string);
IncreaseWantedLevel(ID,1);
IncreasePlayerScore(playerid,1);
return 1;
}
This one doesn't show too, not just reason, but all of the message. No texts, just blank message.
[POLICE RADIO] Law Enforcement Officer %s(%d) has reported %s(%d) for criminal activity. Reason: %s
[POLICE ACTION] Law Enforcement Officer %s(%d) has reported you. Reason: %s",PlayerName(playerid),playerid,message);
This one, it works, but reason is not showing.
However wanted levels is working fine, except the message.
Please help me, thanks!