04.10.2011, 21:55
Hello , i have no Idea how to Make that: The Reports are send only for DutyOn Admins.
this is /adminduty Command:
And this is Report command:
Thanks .
this is /adminduty Command:
PHP Code:
if(strcmp(cmd, "/adminduty", true) == 0 || strcmp(cmd, "/aod", true) == 0 || strcmp(cmd, "/aduty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You are not Connected !");
return 1;
}
if(PlayerInfo[playerid][pAdmin] > 0)
{
if(AdminDuty[playerid] == 0)
{
AdminDuty[playerid] = 1;
SetPlayerArmour(playerid, 999);
SetPlayerHealth(playerid, 999);
SetPlayerColor(playerid, COLOR_LIGHTRED);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[DUTY] %s Is now OnDuty", sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
if(PlayerInfo[playerid][pAdmin] >= 1339)
SafeGivePlayerWeapon(playerid, 38, 11000);
{
for(new i = 0; i < sizeof(CarInfo); i++)
{
SetVehicleParamsForPlayer(i,playerid,0,0);
}
}
return 1;
}
else if(AdminDuty[playerid] == 1)
{
AdminDuty[playerid] = 0;
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 100);
SafeResetPlayerWeapons(playerid);
SetPlayerColor(playerid,COLOR_WHITE);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[DUTY] %s Is OffDuty", sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_BLUE, "You Can Not do that");
return 1;
}
}
return 1;
}
PHP Code:
if(strcmp(cmd, "/report", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /report [ID] [Reason]");
return 1;
}
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /report [ID of the Player] [Reason]");
return 1;
}
format(string, sizeof(string), "%s (%d) reported %s (%d)Reason: %s",sendername, playerid, giveplayer, giveplayerid, (result));
ABroadCast(COLOR_LIGHTRED,string,1);
SendClientMessage(playerid, COLOR_YELLOW, "Your Rapport Was Send to Online Admins.");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "This Player isn't Connected !");
return 1;
}
}
return 1;
}