SA-MP Forums Archive
Gametextforplayer with % progress? - 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: Gametextforplayer with % progress? (/showthread.php?tid=305244)



Gametextforplayer with % progress? - Face9000 - 21.12.2011

Hello guys,i'm scripting a turf system and i need GameTextForPlayer shows the % of taking turf.

I've already the variables/functions to check if the player is in the area,i just need to make this.

Example: "Taking turf..10%...11%...12%" and so on.

Thanks !


Re: Gametextforplayer with % progress? - jamiesage123 - 21.12.2011

I'd do something like this:

pawn Код:
new progress, turfTimer;

forward turfProgress(playerid);

public turfProgress(playerid)
{
//IsPlayerInRangeOfPoint, etc...
    progress++;
    new string[50];
    format(string, sizeof(string), "%d%", progress);
    GameTextForPlayer(playerid, string, 650, 3);
    if(progress == 100) {
        KillTimer(turfTimer);
// Set them owner of that turf, etc.
    }
}


//CMD:taketurf or however you are doing it
progress = 0;
turfTimer = SetTimerEx("turfProgress", 700, true, "i", playerid);



Re: Gametextforplayer with % progress? - skaTim - 21.12.2011

delete.


Re: Gametextforplayer with % progress? - Face9000 - 21.12.2011

Quote:
Originally Posted by jamiesage123
Посмотреть сообщение
I'd do something like this:
Thanks,but i've already my public TakeOver function.

No need to enter in a checkpoint or using a cmd,just entering in a zone.

How to adapt it?


Re: Gametextforplayer with % progress? - Tee - 21.12.2011

The percents sign doesn't work in SA-MP, however you can use the altcode (hold alt and press 0137).
It looks like this: ‰ (Per Mile sign)

When the player enters the checkpoint just set a timer.

pawn Код:
SetTimerEx("turfProgress", 700, true, "i", playerid);



Re: Gametextforplayer with % progress? - Face9000 - 21.12.2011

Oh..thanks


Re: Gametextforplayer with % progress? - -Rebel Son- - 21.12.2011

Why not make a textdraw? they are easy'r to script.


Re: Gametextforplayer with % progress? - Face9000 - 21.12.2011

Quote:
Originally Posted by -Rebel Son-
Посмотреть сообщение
Why not make a textdraw? they are easy'r to script.
Yeah textdraw are better but i've started learning with that.Any help is appreciated.