SA-MP Forums Archive
Little 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: Little Help! (/showthread.php?tid=479984)



Little Help! - Sanady - 08.12.2013

Hello everybody.Does anyone know how to divide time on timer by 2 ?


Re: Little Help! - SkittlesAreFalling - 08.12.2013

SetTimer("SomeFunction", ((10000) / 2), true/false);

We need the code for the timer to help you.


Re: Little Help! - Sanady - 08.12.2013

Quote:
Originally Posted by SkittlesAreFalling
Посмотреть сообщение
SetTimer("SomeFunction", ((10000) / 2), true/false);

We need the code for the timer to help you.
Hmm I tried it but when I enter to the point for capture capturing is very short.So can anyone give me some solutions..?


Re: Little Help! - SkittlesAreFalling - 08.12.2013

Give us the timer code.


Re: Little Help! - Sanady - 08.12.2013

pawn Код:
/*if(pMod[playerid][ShorterTimeForCapture] == 1)
            {
                format(slova,56,"(%d)/2",GangZones[i][CaptureTime]);
                GangZones[i][CapturingTimer] = SetTimerEx("OnPlayerCaptureGangZone", slova[56], 0, "dd", playerid, i);
            }
            else if(pMod[playerid][ShorterTimeForCapture] == 0)
            {
                GangZones[i][CapturingTimer] = SetTimerEx("OnPlayerCaptureGangZone", GangZones[i][CaptureTime], 0, "dd", playerid, i);
            }*/
Here it is!


Re: Little Help! - SkittlesAreFalling - 08.12.2013

Код:
format(slova,56,"(%d)/2",GangZones[i][CaptureTime]);
GangZones[i][CapturingTimer] = SetTimerEx("OnPlayerCaptureGangZone", slova[56], 0, "dd", playerid, i);
to:

Код:
GangZones[i][CapturingTimer] = SetTimerEx("OnPlayerCaptureGangZone", (GangZones[i][CaptureTime]/2), 0, "dd", playerid, i);
format is for strings, it doesn't perform math.

Sorry for delayed response.
Quote:

This forum requires that you wait 240 seconds between posts. Please try again in 64 seconds.