GameTextForPlayer - Disable
#1

Hey guys i'm scripting a taxi fare system which I was wondering if I can disable a GameText
I want to GameText the passenger how many does he need to pay and disable it if he leaves the car
Reply
#2

Use a textdraw for that. There are a few very user-friendly textdraw editors available on the forum.

iPleoMax's TD editor: https://sampforum.blast.hk/showthread.php?tid=376758
Adri1's TD editor: https://sampforum.blast.hk/showthread.php?tid=543002
Reply
#3

You can either use textdraws (I recommend Zamaroht or iPLEOMAX's TextDraw editor) or use GameTextForPlayer function.
Код:
GameTextForPlayer(playerid, "TEXT HERE", 2500, 1);
playerid = player variable
TEXT HERE = enter the text you want to display there
2500 = miliseconds of the text to stay on screen
1 = text's type
Give me your taxi passenger variable and also OnPlayerExitVehicle.
Reply
#4

Quote:
Originally Posted by KevinExec
Посмотреть сообщение
You can either use textdraws (I recommend Zamaroht or iPLEOMAX's TextDraw editor) or use GameTextForPlayer function.
Код:
GameTextForPlayer(playerid, "TEXT HERE", 2500, 1);
playerid = player variable
TEXT HERE = enter the text you want to display there
2500 = miliseconds of the text to stay on screen
1 = text's type
Give me your taxi passenger variable and also OnPlayerExitVehicle.
OnPlayerEnterVehicle
PHP код:
else if(ispassenger)
    {
        
// Taxi Fare
        
new driver GetVehicleDriverID(vehicleid);
        new 
string[128];
        if(
IsTaxiVehicle(vehicleid) && TaxiFare[driver] != && driver != -1)
        {
             
format(stringsizeof(string), "You have entered %s's Taxi, You will pay $%d for every 10 seconds."RPN(driver), TaxiFare[driver]);
            
SendClientMessage(playeridCOLOR_YELLOWstring);
            
FareTimer[playerid] = SetTimerEx("FareAmount"10000true"ii"playeriddriver);
        }
    } 
OnPlayerExitVehicle
PHP код:
if(IsTaxiVehicle(GetPlayerVehicleID(playerid)) && GetPlayerVehicleSeat(playerid) != 0)
    {
        if(
driver != -&& CustomerPay[playerid] != 0)
        {
            new 
string[128];
            new 
amount CustomerPay[playerid];
            
GiveDodMoney(playerid, -amount);
            
GiveDodMoney(driveramount);
            
CustomerPay[playerid] = 0;
            
format(stringsizeof(string), "You have paid %s $%d for the travel."RPN(driver), CustomerPay[playerid]);
            
SendClientMessage(playeridCOLOR_YELLOWstring);
        }
        else
        {
            
CustomerPay[playerid] = 0;
        }
        
KillTimer(FareTimer[playerid]);
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)