03.04.2013, 19:31
Hi!
I have another question...
Is this code OK?
CODE:
I get no ERRORS and ingame everything works, only admins don't get report.
I have another question...
Is this code OK?
CODE:
PHP код:
COMMAND:report(playerid,params[]) {
new
name1[30],
name2[30],
id,
text[128],
reason[50];
if(sscanf(params,"us",id,reason))
return SendClientMessage(playerid, COLOR_RED,"Usage: /report [id] [reason]");
if(IsPlayerConnected(id)) {
SendClientMessage(playerid,COLOR_GREEN,"Thanks for reporting. Your report have been sent to online administartor.");
for(new i = 0; i < MAX_PLAYERS; ++i) {
if(gPlayerInfo[playerid][PLAYER_LEVEL] < 1)
{
GetPlayerName(playerid,name1,sizeof(name1));
GetPlayerName(id,name2,sizeof(name2));
new Hour,Minute,Second;
gettime(Hour,Minute,Second);
format(text,sizeof(text),"|| %d:%d:%d || [Report] | \"%s\" [%i] has reported \"%s\" [%i], reason: %s.",Hour,Minute,Second,name1,playerid,name2,id,reason);
SendClientMessage(i,COLOR_YELLOW,text);
ReportLog(text);
}
}
} else {
return SendClientMessage(playerid,COLOR_RED,"ERROR: This player is not connected.");
}
return 1;
}