CMD:aduty (Help me with skin and colour) -
ReD_HunTeR - 16.01.2014
Код:
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
Re: CMD:aduty (Help me with skin and colour) -
BarFix - 16.01.2014
removed..
Re: CMD:aduty (Help me with skin and colour) -
Wayland - 16.01.2014
Just change the old school things with specific skin id and color
Re: CMD:aduty (Help me with skin and colour) -
ReD_HunTeR - 17.01.2014
how should i ?
can u give any example ?
Re: CMD:aduty (Help me with skin and colour) -
M3HR4N - 17.01.2014
pawn Код:
if(aDuty[playerid] == 1)
{
SetPlayerHealth(playerid, 0);
aDuty[playerid] = 0;
}
it 's better :P
Re: CMD:aduty (Help me with skin and colour) -
ReD_HunTeR - 17.01.2014
M3HR4N dont reply useless thing lol,
i know its good but i need to make that.
Re : CMD:aduty (Help me with skin and colour) -
anou1 - 17.01.2014
I got the same problem :/
Respuesta: CMD:aduty (Help me with skin and colour) -
Stront - 17.01.2014
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.
Re: CMD:aduty (Help me with skin and colour) -
ReD_HunTeR - 17.01.2014
stront its setting skin id to 0 not setting to my old script comon someone will help or not ?
Re: CMD:aduty (Help me with skin and colour) -
Zamora - 17.01.2014
pawn Код:
new oldcolor = GetPlayerColor(playerid);
new oldskin = GetPlayerSkin(playerid);
SetPlayerColor(playerid, oldcolor);
SetPlayerSkin(playerid, oldskin);
That should work.