30.03.2013, 20:05
(
Последний раз редактировалось [..MonTaNa..]; 30.04.2013 в 04:51.
)
.....
// On top of the script
new CommandWaiting[MAX_PLAYERS];
// On the command
COMMAND:armour(playerid, params[])
{
if(CommandWaiting[playerid] == 0);
{
CommandWaiting[playerid] = 1;
SetPlayerArmour(playerid, 100);
SetTimer("waiting", 180000, false);
}
else
SendClientMessage(playerid, 0xAA3333AA, "You are allowed to use this command only 1 time every 3 minutes");
return 1;
}
forward waiting(playerid);
public waiting(playerid)
{
CommandWaiting[playerid] = 0;
return 1;
}
new armour[MAX_PLAYERS];
CMD:armour(playerid)
{
//armour giveing codes
armour(playerid)=1;
SetTimer("Arming(playerid)",30000,0);
}
forward Arming(playerid);
public Arming(playerid)
{
armour(playerid)=0;
}
CMD:armour(playerid,params[]) {
if(GetPVarInt(playerid,"ABUSE")>GetTickCount())return SendMessageToPlayer(playerid,0xFF0000FF,"You must wait 3 minutes before using this command again");
SetPVarInt(playerid,"ABUSE",GetTickCount()+180000);
SetPlayerArmour(playerid,100.0);
return 1;}
forward timer_refillarmor(playerid);
new armortimer[MAX_PLAYERS];
armortimer[playerid] = 1;
if (strcmp("/armor", cmdtext, true, 6) == 0)
{
if(armortimer[playerid] == 1)
{
SetPlayerArmour(playerid,100);
SetTimer("timer_refillarmor",18000,false);
armortimer[playerid] = 0;
}
else
{
SendClientMessage(playerid,0xFF0000FF,"You must wait 3 minutes before using /armor again!");
}
return 1;
}
public timer_refillarmor(playerid)
{
armortimer[playerid] = 1;
return 1;
}
// On top of the script
new CommandWaiting[MAX_PLAYERS];
// On the command
COMMAND:armour(playerid, params[])
{
if(CommandWaiting[playerid] == 0);
{
CommandWaiting[playerid] = 1;
SetPlayerArmour(playerid, 100);
SetTimer("waiting", 180000, false);
}
else
SendClientMessage(playerid, 0xAA3333AA, "You are allowed to use this command only 1 time every 3 minutes");
return 1;
}
forward waiting(playerid);
public waiting(playerid)
{
CommandWaiting[playerid] = 0;
return 1;
}
// On top of the script
new CommandWaiting[MAX_PLAYERS];
// On the command
COMMAND:armour(playerid, params[])
{
if(CommandWaiting[playerid] == 0);
{
CommandWaiting[playerid] = 1;
SetPlayerArmour(playerid, 100);
SetTimerEx("waiting", 180000, false,"i",playerid);
}
else
SendClientMessage(playerid, 0xAA3333AA, "You are allowed to use this command only 1 time every 3 minutes");
return 1;
}
forward waiting(playerid);
public waiting(playerid)
{
CommandWaiting[playerid] = 0;
return 1;
}