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
#2

removed..
Reply
#3

Just change the old school things with specific skin id and color
Reply
#4

how should i ?
can u give any example ?
Reply
#5

pawn Код:
if(aDuty[playerid] == 1)
          {
               SetPlayerHealth(playerid, 0);
               aDuty[playerid] = 0;
          }
it 's better :P
Reply
#6

M3HR4N dont reply useless thing lol,
i know its good but i need to make that.
Reply
#7

I got the same problem :/
Reply
#8

Use the function GetPlayerSkin(playerid); as this.

Код:
new olds[MAX_PLAYERS]; // TOP OF THE COMMAND.

olds[playerid] = GetPlayerSkin(playerid); // WHEN GOING ADUTY.

SetPlayerSkin(playerid, olds[playerid]); // WHEN GOING OFFDUTY.
And the color you can set this one.

Код:
SetPlayerColor(playerid,0xFFFFFF00); // OR JUST AN INVISIBLE ONE.
Reply
#9

stront its setting skin id to 0 not setting to my old script comon someone will help or not ?
Reply
#10

pawn Код:
new oldcolor = GetPlayerColor(playerid);
             new  oldskin = GetPlayerSkin(playerid);

SetPlayerColor(playerid, oldcolor);
               SetPlayerSkin(playerid, oldskin);
That should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)