26.01.2014, 10:27
Well, This is my god command. Now, It turns on when I use /vgod, What I need now is, When a player types /vgod again, It should be turned off.
Thanks in advance.
pawn Код:
dcmd_vgod(playerid,params[])
{
#pragma unused params
if(IsSpawned[playerid] != 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to go into god mode.");
return 1;
}
for(new w=0; w<13; w++)
{
GetPlayerWeaponData(playerid,w,PlayerWeapon[playerid][w],PlayerAmmo[playerid][w]);
}
SendClientMessage(playerid,COLOR_VIOLETBLUE,"You are now in god mode. You now have infinite health, armour and VIP Weapons.");
ResetPlayerWeapons(playerid);
InVIPMode[playerid] =1;
GivePlayerWeapon(playerid,24,999999);
GivePlayerWeapon(playerid,26,999999);
GivePlayerWeapon(playerid,29,999999);
GivePlayerWeapon(playerid,31,999999);
SetPlayerHealth(playerid,999999);
SetPlayerArmour(playerid,999999);
return 1;
}