where
?
|
Originally Posted by nuriel8833
3.I need that the player can send one reported about another player in 2 minutes.
like bla has benn reported bli,bla can send a report about bli only in 2 seconds. and it will send a message to the player You already reported %s(ID: %d) |
dcmd_report(playerid, params[])
{
new
pID,
message[64],
string[128],
ThePlayer[MAX_PLAYER_NAME],
TheOtherPlayer[MAX_PLAYER_NAME];
if(sscanf(params, "ds",pID, message))
{
SendClientMessage(playerid, COLOR, "Usage: /report [ID] [REASON]");
return 1;
}
if(!IsPlayerConnected(pID))
{
format(string, sizeof(string), "No player with ID %d is connected.", pID);
SendClientMessage(playerid, COLOR, string);
return 1;
}
GetPlayerName(playerid,ThePlayer,sizeof(ThePlayer));
GetPlayerName(pID, TheOtherPlayer,sizeof(TheOtherPlayer));
format(string,sizeof(string,"You have benn reported %s(ID: %d) for %s", TheOtherPlayer, pID, message);
SendClientMessage(playerid, COLOR, string);
format(string,sizeof(string),"[Report Sys] The player %s(ID:%d) reported %s (ID:%d) for %s",ThePlayer,playerid,TheOtherPlayer,pID,message);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerAdmin(i))
{
SendClientMessage(i, COLOR, string);
}
}
}
return 1;
}
if(strcmp(cmd, "/report", true) == 0)
{
new tmp[128],reason[128];
tmp = strtok(cmdtext, idx);
if(!tmp[0]) return SendClientMessage(playerid,COLOR_RED,"USAGE: /report [playerid] [reason]");
new player = strval(tmp);
reason = extrastrtok(cmdtext, idx);
new string[128];
new playername[MAX_PLAYER_NAME],reportedname[MAX_PLAYER_NAME];
GetPlayerName(player,reportedname,sizeof(reportedname)); GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"[Report Sys] You reported %s for %s",reportedname,reason);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string,sizeof(string),"[Report Sys] The player %s was reported by %s for %s",reportedname,playername,reason);
for(new i = 0; i < MAX_PLAYERS; i++)
{
// Here your Admindefinition
SendClientMessage(i,COLOR_YELLOW,string);
}
return 1;
}