11.05.2016, 02:03
i Have problem with timer. i create settimer in onplayerentercheckpoint but timmer cannot execute this my code
why time not execute?
PHP код:
forward bsampah(playerid);
forward csampah(playerid);
public bsampah(playerid)
{
TogglePlayerControllable(playerid, 1);
tsampah[playerid] = SetPlayerCheckpoint(playerid,2290.5510,-2117.1140,14.0950,3);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* sampah berhasil di naikan. pergi ke penbuangan");
jsampah[playerid]=2;
}
public csampah(playerid)
{
GivePlayerMoney(playerid,2500);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* sampah telah di buang");
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Kamu mendapatkan $2500 dari membuang sampah");
jsampah[playerid]=0;
TogglePlayerControllable(playerid, 1);
DisablePlayerCheckpoint(playerid);
}
onplayercheckpoint
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 408)
{
if (jsampah[playerid]==1)
{
TogglePlayerControllable(playerid, 0);
SetTimer("bsampah", 5000, 0);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* proses menaikan sampah");
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* proses............");
//tidebos
}
if (jsampah[playerid]==2)
{
TogglePlayerControllable(playerid, 0);
SetTimer("csampah", 5000, 0);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* proses munurunkan sampah");
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* proses............");
//tidebos
}
}