|
CMD:varmor(playerid,params[]) { if(Player[playerid][VipRank] >= 2) { SetPlayerArmour(playerid, 100); } } |
CMD:varmor(playerid, params[])
{
new string[128], armor;
if(sscanf(params, "d", armor))
{
SendClientMessageEx(playerid, COLOR_GRAD2, "USAGE: /varmor [health]");
return 1;
}
if(Player[playerid][VipRank] >= 2)
{
SetPlayerArmour(playerid, armor);
format(string, sizeof(string), "You have set your armor to %d.", armor);
SendClientMessageEx(playerid, COLOR_WHITE, string);
}
return 1;
}
new viparmortimer
new string[128];
if(Player[playerid][VipRank] >= 2)
{
format(string, sizeof(string), "You must wait 30 minutes to use this command. ");
SendClientMessageEx(playerid, COLOR_GREY, string);
return 1;
}
if(Player[playerid][VipRank] >= 2)
{
viparmortimer[playerid] = 108000;
}
new viparmortimer = 108000;
new viparmortimer ;
new bool:ArmourUsed[MAX_PLAYERS]; // Create bool..
// OnPlayerConnect
// ArmourUsed[playerid] = false;
CMD:varmor(playerid,params[])
{
if(ArmourUsed[playerid] == false)
{
if(Player[playerid][VipRank] >= 2)
{
SetPlayerArmour(playerid, 100.0);
ArmourUsed[playerid] = true;
SetTimerEx("WaitTime", 60000*30, false, "i", playerid);
}
}
else return SendClientMessage(playerid, -1, " Wait 30 min ");// you text
return 1;
}
forward WaitTime(playerid);
public WaitTime(playerid)
{
ArmourUsed[playerid] = false;
return 1;
}