Gametextforplayer with % progress?
#1

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 !
Reply
#2

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);
Reply
#3

delete.
Reply
#4

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?
Reply
#5

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);
Reply
#6

Oh..thanks
Reply
#7

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)