28.04.2013, 02:05
pawn Код:
new vip[MAX_PLAYERS]; //Variable for VIP
new VipTimer[MAX_PLAYERS];
//every minute since the server start
forward VipHealth(playerid);
public VipHealth(playerid)
{
new vipstate = GetPlayerState(playerid);
if(IsPlayerConnected(playerid) && vipstate == 1 || vipstate == 2 && IsPlayerConnected(playerid)) // checks to see if the player is connect and is a vip
{
new Float: vHealth;//variable
GetPlayerHealth(playerid, vHealth); // setting a value to vHealth which is = to the player health
SetPlayerHealth(playerid, vHealth + 5); // Sets the player Health +5
}
return 1;
}
public OnPlayerConnect(playerid)
{
if(vip[playerid] >= 1)
{
VipTimer[playerid] = SetTimerEx("VipHealth", 60000, true, "i", playerid);
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
KillTimer(VipTimer[playerid]);
return 1;
}