Help with timer - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with timer (
/showthread.php?tid=566733)
Delete this -
RedCode - 07.03.2015
Deleted
Re : Help with timer -
Golimad - 07.03.2015
Check out
https://sampwiki.blast.hk/wiki/SetTimerEx
Код:
new VipLockerTimer[MAX_PLAYERS], // in top of script.
bool:CanUseLocker[MAX_PLAYERS];
OnPlayerConnect(playerid): CanUseLocker[playerid] = true;
in command :
CanUseLocker[playerid] = false;
VipLockerTimer[playerid] = SetTimerEx ...... ( when timer is done : CanUseLocker[playerid] = true; )
Ur command will become :
Код:
CMD:viplocker(playerid, params[])
{
if(!CanUseLocker[playerid]) return SendClientMessage(playerid, COLOR_WHITE, "You have to wait before using locker again.");
if(PlayerInfo[playerid][pDonator] >= 1)
{
if(IsPlayerInRangeOfPoint(playerid,3,-2653.1226, 1410.2570 ,906.2734))
{
ShowPlayerDialogEx(playerid, viplocker, DIALOG_STYLE_LIST, "VIP Locker", "Health\nArmour\nDeagle", "Select", "Cancel");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You arent in correct place.");
}
}
return 1;
}
Re: Help with timer -
RedCode - 07.03.2015
Man check PM!
Re : Help with timer -
Golimad - 08.03.2015
Код:
new VipLockerTimer[MAX_PLAYERS], // in top of script.
bool:CanUseLocker[MAX_PLAYERS];
OnPlayerConnect(playerid)
CanUseLocker[playerid] = true; // add this
Код:
CMD:viplocker(playerid, params[])
{
if(CanUseLocker[playerid]==false) return SendClientMessage(playerid, COLOR_WHITE, "You have to wait before using locker again.");
if(PlayerInfo[playerid][pDonator] >= 1)
{
if(IsPlayerInRangeOfPoint(playerid,3,-2653.1226, 1410.2570 ,906.2734))
{
ShowPlayerDialogEx(playerid, viplocker, DIALOG_STYLE_LIST, "VIP Locker", "Health\nArmour\nDeagle", "Select", "Cancel");
VipLockerTimer[playerid] = SetTimerEx("VipLockerTime", 3600*1000, false, "i", playerid);
CanUseLocker[playerid] = false;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You arent in correct place.");
}
}
return 1;
}
forward VipLockerTime(playerid);
public VipLockerTime(playerid)
{
CanUseLocker[playerid] = true;
return 1;
}
This is all I can help you with.
Re: Help with timer -
RedCode - 08.03.2015
I have a problem , when i try to get health i cant take that , when i use armour i take health something wrong with dialog can u make me OnDialogResponse how to buy Health armour and deagle please ?