17.08.2013, 11:07
i think that can help :
Quote:
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(IsKidnapped[playerid] == 1) { SendClientMessage(playerid,COLOR_ERROR,"You are kidnapped. You cannot use this command."); return 1; } if(IsFrozen[playerid] == 1) { SendClientMessage(playerid,COLOR_ERROR,"You have been frozen by a Server Administrator. You cannot use this command."); return 1; } if(gTeam[playerid] != TEAM_COP && gTeam[playerid] != TEAM_ARMY && gTeam[playerid] != TEAM_CIA) { SendClientMessage(playerid,COLOR_ERROR,"Only law enforcement can report criminals on the police radio."); return 1; } if(InAdminMode[ID] == 1) { SendClientMessage(playerid,COLOR_ERROR,"You cannot use this command on this player because they are in Administrator mode."); 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] == TEAM_COP || gTeam[ID] == TEAM_ARMY || gTeam[ID] == TEAM_CIA) { 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; } if(HasBeenReportedRecently[ID] >= 1) { format(string,sizeof(string),"%s(%d) has been reported for criminal activity lately. You cannot report them",PlayerName(ID),ID); SendClientMessage(playerid,COLOR_ERROR,string); return 1; } new message =strval(cmdreason); 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),I D,message); SendClientMessageToAllCops(string); format(string,sizeof(string),"12[POLICE RADIO] Law Enforcement Officer %s(%d) has reported %s(%d) for criminal activity. Reason: %s",PlayerName(playerid),playerid,PlayerName(ID), ID,message); IRC_GroupSay(gGroupAdminID,IRC_CHANNEL,string); format(string,sizeof(string),"[POLICE ACTION] Law Enforcement Officer %s(%d) has reported you. Reason: %s",PlayerName(playerid),playerid,message); SendClientMessage(ID,COLOR_DODGERBLUE,string); TextDrawSetString(MessageTD[ID],"TICKET RECIEVED"); TextDrawShowForPlayer(ID,MessageTD[ID]); MessageTDTime[ID] =5; IncreaseWantedLevel(ID,2); HasBeenReportedRecently[ID] =60; IncreasePlayerScore(playerid,1); return 1; } |