CMD:aduty (Help me with skin and colour)
#1

Код:
CMD:aduty(playerid, params[])
{
    new string[128], oldskin[MAX_PLAYERS], oldcolor[MAX_PLAYERS];
    if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid))
	{
          if(aDuty[playerid] == 1)
          {
               SetPlayerHealth(playerid, 100.00);
               SetPlayerArmour(playerid, 100.00);
               PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
               SendClientMessage(playerid,COLOR_RED,"God Mode Off, Enjoy..");
               SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
               SetPlayerColor(playerid, oldcolor[playerid]);
               SetPlayerSkin(playerid, oldskin[playerid]);
               format(string, sizeof(string), "%s %s is now off Duty.",AdminLevelName(playerid),PlayerName(playerid));
               SendClientMessageToAll(COLOR_ORANGE,string);
               SetPlayerToTeamWeapons(playerid);
               aDuty[playerid] = 0;
          }
          else if(aDuty[playerid] == 0)
		  {
               SetPlayerHealth(playerid, 99999.99);
               SetPlayerArmour(playerid, 99999.99);
               SetVehicleHealth(GetPlayerVehicleID(playerid),10000);
               PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
               weaponallow[playerid] = 1;
               GivePlayerWeapon(playerid, 38, 99999);
               oldcolor[playerid] = GetPlayerColor(playerid);
               oldskin[playerid] = GetPlayerSkin(playerid);
               SetPlayerSkin(playerid, 217);
               SetPlayerColor(playerid, COLOR_RED);
               SendClientMessage(playerid,COLOR_RED,"God Mode On, Please Donot abuse...");
               format(string, sizeof(string), "%s %s is now on Duty.",AdminLevelName(playerid),PlayerName(playerid));
               SendClientMessageToAll(COLOR_ORANGE,string);
               aDuty[playerid] = 1;
          }
	}
    else SendClientMessage(playerid,COLOR_RED,"You do not have the right admin permissions for this command!");
    return 1;
}
thats the code, and i need to fix oldskin and oldcolor, its not fixed, when i do /aduty it on duty but when i do again it make offduty and set black colour and SKin id 0
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)