SA-MP Forums Archive
Warnings - 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: Warnings (/showthread.php?tid=310040)



Warnings - vent - 10.01.2012

Hello!
pawn Код:
new string[64],tmphour, tmpminute, tmpsecond, ghour, gameHour, gameMinute, gameSecond, shifthour;
    gettime(tmphour, tmpminute, tmpsecond);
    FixHour(tmphour);
    tmphour = shifthour;
    ghour = tmphour; //warning
    gettime(gameHour, gameMinute, gameSecond);
    gameHour = FixHour(gameHour);
    SetWorldTime(tmphour);
This is my code. Its in OnGameModeInit.

This is my other code.
pawn Код:
FixHour(hour)
{
    new timeshift, shifthour;
    hour = timeshift+hour;
    if(hour < 0)
    {
        hour = hour+24;
    }
    else if(hour > 23)
    {
        hour = hour-24;
    }
    shifthour = hour; //warning
    return 1;
}
These are the warnings.
Код:
C:\Users\tuumajaam\Desktop\DreamRP Gaming + UCP [MySQL]\Server 1 [MySQL] - RP\gamemodes\mysql.pwn(50) : warning 204: symbol is assigned a value that is never used: "ghour"
C:\Users\tuumajaam\Desktop\DreamRP Gaming + UCP [MySQL]\Server 1 [MySQL] - RP\gamemodes\mysql.pwn(292) : warning 204: symbol is assigned a value that is never used: "shifthour"
Can somebody solve this?


Re: Warnings - ScriptJorkis - 10.01.2012

Make sure that you use ghour and shifthour example:

pawn Код:
new JamboTimer;

public OnPlayerText(playerid, text)
{
//The codes that use in JamboTimer <<< You use JamboTimer but however the pawno read it as unused so below you will see how to use it properly
    return 0;
}

//OnGamemodeInitExit
KillTimer(JamboTimer); //JamboTimer is being used here