GameTextForPlayer not showing - 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 not showing (
/showthread.php?tid=675595)
GameTextForPlayer not showing -
ChandraLouis - 16.05.2020
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;
}
Re: GameTextForPlayer not showing -
beckzy - 16.05.2020
Size needs to be bigger. Try:
Re: GameTextForPlayer not showing -
ChandraLouis - 16.05.2020
I stayed in the checkpoint for more than 30 sec but nothing happens. Also the text only shows up once then disappear.
Re: GameTextForPlayer not showing -
ChandraLouis - 16.05.2020
Fixed it.