26.01.2016, 20:08
Ok so i've been working with timers for a day and still don't know all the pawno syntax and all.
What I wanna do is, when timer reach 0 seconds : it destroy the dynamic object CowFence. It creates it when the timer starts and when its going down. But it doesnt destroy it at 0 but it do kill the timer.
Any help is highly apreciated
What I wanna do is, when timer reach 0 seconds : it destroy the dynamic object CowFence. It creates it when the timer starts and when its going down. But it doesnt destroy it at 0 but it do kill the timer.
Any help is highly apreciated
PHP код:
forward CowTimeCooldown(playerid);
public CowTimeCooldown(playerid)
{
if(CowTime[playerid] > 0)
{
CowTime[playerid] --;
}
else if(CowTime[playerid] == 0)
{
new string[128], cow;
CowFence = CreateDynamicObject(19833, -380.1285,-1472.2924,25.7266, -0.000003, 1.099999, -68.199905,0);
PlayerInfo[playerid][pCow][cow] = PlayerInfo[playerid][pCow][cow] += 50;
format(string, sizeof(string), "* %s has fed his cow and it got bigger by 50 lbs", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
DestroyDynamicObject(CowFence);
KillTimer(CowCooldown[playerid]);
}
return 1;
}