SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 16/05/2020, 05:27 PM   #1
ChandraLouis
Banned
 
Join Date: Mar 2013
Location: Indonesia
Posts: 438
Reputation: 37
Default GameTextForPlayer not showing

The title explains it all.

pawn Code:
forward robbanktimer(playerid);
public robbanktimer(playerid)
{
    if(StopRobCount[playerid] == 0)
    {
        new string[128];
        new cash = RandomCash(150000, 180000);
        GivePlayerCash(playerid, cash);

        ClearAnimations(playerid);

        for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
        {
            if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
        }

        format(string, sizeof(string), "~w~ROBBED %d~n~FROM THE BANK", cash);
        GameTextForPlayer(playerid, string, 3000, 4);
        format(string, sizeof(string),""COL_YELLOW"[BANK ROBBERY] {FFFFFF}%s have robbed a total of "COL_GREEN"$%d{FFFFFF} from "COL_GREEN"Los Santos City Bank{FFFFFF}.", GetName(playerid), cash);
        SendClientMessageToAll(-1, string);
        SendClientMessageToAll(-1, ""COL_YELLOW"[BANK] {FFFFFF}Los Santos City Bank will not be available for robbery for 15 minutes.");
        KillTimer(StopRob[playerid]);
    }
    else
    {
        StopRobCount[playerid] --;
        new strz[20];
        format(strz, sizeof strz, "~w~Time Left: %i~n~~b~STAY IN THE~n~RED CHECKPOINT", StopRobCount[playerid]);
        GameTextForPlayer(playerid, strz, 1000, 4);
    }
}

Here's the rob command if needed:
pawn Code:
CMD:robbank(playerid, params[])
{
    if(robpossible == 1)
    {
        if(IsPlayerInDynamicCP(playerid, CP_RobBank))
        {
            new string[300];
            robpossible = 0;
            StopRobCount[playerid] = 30;
            SetTimer("robwaittimer", 900000, false);
            StopRob[playerid] = SetTimer("robbanktimer", 1000, false);
            SetPlayerAttachedObject(playerid, 0, 1550, 1, 0.0840, -0.3049, 0.0369, 40.5000, 88.7000, -4.3999, 1.0000, 1.0000, 1.0000, 0, 0);

            format(string,sizeof(string),"[POLICE RADIO] Los Santos City Bank is being robbed by %s and requesting help right now.", GetName(playerid));
            SendMessageToAllCops(string);
            SendClientMessage(playerid, 0x008CBAFF, "You have started a bank robbery, stay in the checkpoint for 30 seconds or else the robbery will fail.");
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, ""COL_RED"[ERROR] {FFFFFF}You have to be in the checkpoint to begin a robbery!");
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, ""COL_RED"[ERROR] {FFFFFF}The bank have been robbed recently.");
    }
    return 1;
}
ChandraLouis is offline   Reply With Quote
Old 16/05/2020, 05:49 PM   #2
beckzy
Beta Tester
 
Join Date: Dec 2006
Posts: 1,288
Reputation: 172
Default Re: GameTextForPlayer not showing

Code:
new strz[20];
Size needs to be bigger. Try:

Code:
new strz[64];
__________________
beckzy is offline   Reply With Quote
Old 16/05/2020, 05:52 PM   #3
ChandraLouis
Banned
 
Join Date: Mar 2013
Location: Indonesia
Posts: 438
Reputation: 37
Default Re: GameTextForPlayer not showing

I stayed in the checkpoint for more than 30 sec but nothing happens. Also the text only shows up once then disappear.
ChandraLouis is offline   Reply With Quote
Old 16/05/2020, 11:00 PM   #4
ChandraLouis
Banned
 
Join Date: Mar 2013
Location: Indonesia
Posts: 438
Reputation: 37
Default Re: GameTextForPlayer not showing

Fixed it.
ChandraLouis is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GameTextForPlayer Not showing skydux123 Scripting Help 1 14/12/2013 05:10 PM
GameTextForPlayer Not showing a text CoaPsyFactor Scripting Help 5 11/06/2012 02:45 PM
GametextforPlayer: iRana Help Archive 4 02/12/2010 12:10 PM
need a bit help with GameTextForPlayer Daniel_Truk Help Archive 13 09/09/2009 01:51 PM


All times are GMT. The time now is 09:57 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.