26.02.2013, 14:24
Greetings,
I have this script, I made this in my GM but now I want to when someone (admin) use /adminduty, it change the player color to COLOR_CYAN
Regards,
Pablo
P.S: This command work.
I have this script, I made this in my GM but now I want to when someone (admin) use /adminduty, it change the player color to COLOR_CYAN
Regards,
Pablo
pawn Код:
CMD:adminduty(playerid, params[])
{
new str[126];
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You are not authorized to use this command.");
if(GetPVarInt(playerid, "Injured") == 1) return SendClientMessage(playerid, COLOR_GREY, "WARNING: You may not go on duty while injured, /giveup if emergency.");
if(AdminDuty[playerid] != 1)
{
AdminDutyCash[playerid] = PlayerInfo[playerid][pCash];
GetPlayerHealth(playerid, AdminDutyHealth[playerid]);
AdminDutyArmor[playerid] = PlayerInfo[playerid][pArmor];
AdminDuty[playerid] = 1;
format(str, sizeof(str), "%s (ID %i - %s) is now on duty as a level %i admin.", PlayerInfo[playerid][pAName], playerid, GetName(playerid), PlayerInfo[playerid][pAdmin]);
SendClientMessageToAdmins(-1, str, 1);
SetPlayerName(playerid, PlayerInfo[playerid][pAName]);
SendClientMessage(playerid, -1, "STAFF: You are now on duty as an admin, you do now have access to all of your commands.");
GetPlayerPos(playerid, PlayerInfo[playerid][pAx], PlayerInfo[playerid][pAy], PlayerInfo[playerid][pAz]);
}
else
{
waitcheck[playerid] = 2;
SetPVarInt(playerid, "SpecOff", 1);
TogglePlayerSpectating(playerid, false);
SetCameraBehindPlayer(playerid);
AdminDuty[playerid] = 0;
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ], 0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
SetPlayerWeapons(playerid);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
SetPlayerName(playerid, PlayerInfo[playerid][pName]);
new backup[126];
format(backup, 126, "%s Old cash: %i - New cash: %i", GetName(playerid), PlayerInfo[playerid][pCash], AdminDutyCash[playerid]);
Log("/logs/backup.txt", backup);
PlayerInfo[playerid][pCash] = AdminDutyCash[playerid];
SetPlayerPos(playerid, PlayerInfo[playerid][pAx], PlayerInfo[playerid][pAy], PlayerInfo[playerid][pAz]);
format(str, sizeof(str), "%s (ID %i - %s) is now off admin duty.", PlayerInfo[playerid][pAName], playerid, GetName(playerid));
SendClientMessageToAdmins(-1, str, 1);
SendClientMessage(playerid, -1, "STAFF: You are now off duty as an admin and have only a limited access to your commands.");
spec[playerid] = -1;
SetPlayerWeaponsEx(playerid);
}
return 1;
}