18.06.2012, 14:47
You shoudl use SetplayerTeamFromClass if you want specific skins to be of specific teams.
In your duty command I could not find a variable that tells us if an admin is currently on duty or not.
For that you may create enum or a global variable.
i will show you with enum (as you can easily edit it after)
Declaring enum
Now, lets make your fly command.
In your duty command I could not find a variable that tells us if an admin is currently on duty or not.
For that you may create enum or a global variable.
i will show you with enum (as you can easily edit it after)
Declaring enum
pawn Код:
enum PlayerInfo
{
pDuty,
}
new pInfo[MAX_PLAYERS][PlayerInfo];
pawn Код:
CMD:onduty(playerid,parmas[])
{
if(IsPlayerLuxAdminLevel(playerid,2))
{
SetPlayerSkin(playerid,217);
GivePlayerWeapon(playerid,38,500000);
SetPlayerHealth(playerid,999999999);
SetPlayerArmour(playerid,999999999);
SetPlayerColor(playerid,COLOR_PINK);
pInfo[playerid][pDuty] = 1; //Player is now on duty
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"ADM CMD: %s is Now On An Admin Duty",pName);
SendClientMessageToAll(0xFF66FFAA,string);
}
else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not Administrator of Level 2");
return 1;
}
CMD:offduty(playerid,parmas[])
{
if(IsPlayerLuxAdminLevel(playerid,2))
{
pInfo[playerid][pDuty] = 0;//Player is off duty
ResetPlayerWeapons(playerid);
ForceClassSelection(playerid);
SetPlayerHealth(playerid,0);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"ADM CMD: %s is End With His Admin Duty",pName);
SendClientMessageToAll(0xFF66FFAA,string);
}
else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not Administrator of Level 2");
return 1;
}
pawn Код:
CMD:fly(playerid,parmas[])
{
if(IsPlayerLuxAdminLevel(playerid,2))
{
if (pInfo[playerid][pDuty] == 0) return SendClientMessage(playerid, COLOR_RED,"ERROR: You must be on duty to use this cmd.");
else StartFly(playerid);
}
else SendClientMessage(playerid, COLOR_RED, "ERROR: You need to be on level 5 to use this CMD");
return 1;
}
CMD:stopfly(playerid,parmas[])
{
if(IsPlayerLuxAdminLevel(playerid,2))
{
StopFly(playerid);
}
else SendClientMessage(playerid, COLOR_RED, "ERROR: You need to be on level 5 to use this CMD");
return 1;
}