Timer Help - 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: Timer Help (
/showthread.php?tid=515963)
Timer Help -
Pboachie - 28.05.2014
Hello everyone

. So today, i want to make a cmd say 2 things but 5 seconds apart. How may i do that with this
Under public OnGameModeInit()
Код:
public OnGameModeInit()
{
SetTimer("PayDay", 3600000, true);
SetTimer("VPayDay", 3540000, true);
The Command
Код:
CMD:payday(playerid)
{
if(pInfo[playerid][pAdminLevel] >= 9)
{
PayDay(); // I want these 5 sec appart
VPayDay(playerid);
SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" Done!");
}
else {
SendClientMessage(playerid,-1,""chat""COL_RED" You do not have admin permission to use this command!");
}
return 1;
}
THeir Forwards
Код:
forward VPayDay(playerid);
public VPayDay(playerid)
{
if(pInfo[playerid][pVipLevel] >= 1)
{
pInfo[playerid][pVPoints] += 10;
GameTextForPlayer(playerid, "VIP Bonus: ~w~You have received ~r~10 VIP Points ~w~and ~r~Enjoy", 3000, 4);
}
return 1;
}
forward PayDay();
public PayDay()
{
foreach(Player, i)
{
GivePlayerXP(i, 300);
GameTextForPlayer(i, "It's ~r~PayDay!!! ~w~you have received ~r~300xp ~w~and ~r~Enjoy", 3000, 5);
}
return 1;
}
forward PressJumpReset(playerid);
public PressJumpReset(playerid)
{
PlayerPressedJump[playerid] = 0; // Reset the variable
return 1;
}
Re: Timer Help -
Jefff - 29.05.2014
pawn Код:
SetTimer("PayDay", 5*1000, false); // I want these 5 sec appart
Re: Timer Help -
VenomMancer - 29.05.2014
pawn Код:
SetTimer("PayDay", 5000, true); // 1000 = 1 sec
Re: Timer Help -
Pboachie - 29.05.2014
Thank you guys!