Код:
stock RangeBan(playerid)
{
new ip[20];
GetPlayerIp(playerid,ip,20);
strdel(ip,strlen(ip)-2,strlen(ip));
format(ip,128,"%s**",ip);
format(ip,128,"banip %s",ip);
SendRconCommand(ip);
}
stock Slap(playerid)
{
new Float:X,Float:Y,Float:Z,
Float:pHealth;
GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(playerid,X,Y,Z+7);
GetPlayerHealth(playerid,pHealth);
SetPlayerHealth(playerid,pHealth - 10);
}
stock Explode(playerid)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
CreateExplosion(X,Y,Z,13,25);
Kill(playerid);
}
stock Crash(playerid)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
CreatePlayerObject(playerid,111111,X,Y,Z,0,0,0);
}
stock GiveCar(playerid,vehid)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
CreateVehicle(vehid,X,Y,Z,0,-1,-1,6000);
}
stock Freeze(playerid)
{
TogglePlayerControllable(playerid,false);
}
stock Unfreeze(playerid)
{
TogglePlayerControllable(playerid,true);
}
stock GivePlayerHealth(playerid,amount)
{
new Float:Health;
GetPlayerHealth(playerid,Health);
if(IsPlayerConnected(playerid))
{
SetPlayerHealth(playerid,Health + amount);
}
return 1;
}
stock TakePlayerHealth(playerid,amount)
{
new Float:Health;
GetPlayerHealth(playerid,Health);
if(IsPlayerConnected(playerid))
{
SetPlayerHealth(playerid,Health - amount);
}
return 1;
}
stock GivePlayerArmour(playerid,amount)
{
new Float:Armour;
GetPlayerArmour(playerid,Armour);
if(IsPlayerConnected(playerid))
{
SetPlayerArmour(playerid,Armour + amount);
}
return 1;
}
stock TakePlayerArmour(playerid,amount)
{
new Float:Armour;
GetPlayerArmour(playerid,Armour);
if(IsPlayerConnected(playerid))
{
SetPlayerArmour(playerid,Armour - amount);
}
return 1;
}
stock Kill(playerid)
{
SetPlayerHealth(playerid,0.0);
return 1;
}
TakePlayerArmour and TakePlayerHealth are used like in the sense that if say John has 100 health and i do TakePlayerHealth(John,20); John would have 80 health, same thing goes for TakePlayerArmour, GivePlayerArmour just adds to the players armour not sets it.