19.01.2018, 14:44
PHP код:
CMD:setscore(playerid, params[])
{
new options[128], targetid, score, string[144];
if(pInfo[playerid][Admin] >= 5)
if(pInfo[targetid][Admin] == ServerInfo[MaxAdminLevel] && pInfo[playerid][Admin] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,RED,"SERVER: You are not authorized to use this command on this admin.");
if(IsPlayerConnected(targetid) && targetid != INVALID_PLAYER_ID)
if(sscanf(params, "us[128]d",targetid,options,score))
{
SendClientMessage(playerid, -1, "Usage: /setscore [playerid] [Option] [score]");
SendClientMessage(playerid, -1, "{FF0000}Option:{00FF00}Criminal, Cop, Paramedic");
return 1;
}
else if(!strcmp(options, "Criminal", true, 5))
{
CMDMessageToAdmins(playerid,"SETSCORE");
format(string, sizeof(string), "You have set \"%s's\" criminal level to '%d' ", pInfo[playerid][Name], score); SendClientMessage(playerid,blue,string);
if(targetid != playerid) { format(string,sizeof(string),"Administrator \"%s\" has set your criminal level to '%d'", pInfo[playerid][Name], score); SendClientMessage(targetid,blue,string); }
return SetPlayerCriminal(targetid, score);
pInfo[targetid][Criminal] = score;
}
else if(!strcmp(options, "Cop", true, 5))
{
CMDMessageToAdmins(playerid,"SETSCORE");
format(string, sizeof(string), "You have set \"%s's\" criminal level to '%d' ", pInfo[playerid][Name], score); SendClientMessage(playerid,blue,string);
if(targetid != playerid) { format(string,sizeof(string),"Administrator \"%s\" has set your cop level to '%d'", pInfo[playerid][Name], score); SendClientMessage(targetid,blue,string); }
return SetPlayerCop(targetid, score);
pInfo[targetid][Cop] = score;
}
else if(!strcmp(options, "Paramedic", true, 5))
{
CMDMessageToAdmins(playerid,"SETSCORE");
format(string, sizeof(string), "You have set \"%s's\" criminal level to '%d' ", pInfo[playerid][Name], score); SendClientMessage(playerid,blue,string);
if(targetid != playerid) { format(string,sizeof(string),"Administrator \"%s\" has set your paramedic level to '%d'", pInfo[playerid][Name], score); SendClientMessage(targetid,blue,string); }
return SetPlayerParamedic(targetid, score);
pInfo[targetid][Paramedic] = score;
}
else SendClientMessage(playerid, COLOR_RED, "Invalid Option.");
else return SendClientMessage(playerid,RED,"SERVER: Player is not connected");
else return SendClientMessage(playerid,RED,"SERVER: You are not authorized to use this command.");
return 1;
}