Problem with value. Simple
#1

Ok so I'm having a hard time figuring this out. I know it's a simple mistake but when I run the script and start the timer, the timer works but when it reaches 5 second ( else if(CowTime[playerid] == 5) ) , this part doesn't work. Looks like ''cw'' isnt well defined or syntax is wrong.

So this part doesnt work
PHP Code:
   PlayerInfo[playerid][pCow][cow] += cw;
        
format(stringsizeof(string), "* Your cow has been fed and got bigger by %d lbs"cw);
        
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
        
DestroyDynamicObject(CowFence); 
This is the whole timer

PHP Code:
forward CowTimeCooldown(playerid);
public 
CowTimeCooldown(playerid)
{
    if(
CowTime[playerid] > 0)
    {
        
CowTime[playerid] --;
    }
    else if(
CowTime[playerid] == 5)
    {
           new 
string[128], cow;
           new 
cw;
        if(
PlayerInfo[playerid][pJobSkill][JOB_FARMER] < 100cw 50;
        else if(
PlayerInfo[playerid][pJobSkill][JOB_FARMER] < 300cw 75;
        else if(
PlayerInfo[playerid][pJobSkill][JOB_FARMER] < 700cw 100;
        else if(
PlayerInfo[playerid][pJobSkill][JOB_FARMER] < 1200cw 125;
        else if(
PlayerInfo[playerid][pJobSkill][JOB_FARMER] >= 1200cw 150;
        
PlayerInfo[playerid][pCow][cow] += cw;
        
format(stringsizeof(string), "* Your cow has been fed and got bigger by %d lbs"cw);
        
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
        
DestroyDynamicObject(CowFence);
        
KillTimer(CowCooldown[playerid]);
       }
    return 
1;

Thanks much
Reply


Messages In This Thread
Problem with value. Simple - by Mikeydoo - 27.01.2016, 02:01
Re: Problem with value. Simple - by [KHK]Khalid - 27.01.2016, 03:13
Re: Problem with value. Simple - by Mikeydoo - 27.01.2016, 19:34

Forum Jump:


Users browsing this thread: 1 Guest(s)