PDA

View Full Version : GameTextForPlayer Not showing a text


CoaPsyFactor
11/06/2012, 02:15 PM
Hi there,

I have little problem with GameTextForPlayer, when player pickup some pickup it should show GameText of pickup, it works fine when i call it in OnPlayerPickUpPickup, but when i call it from OnPlayerPickUpDynamicPickup, it doesn't show text, as you can see in code i print some of information's i need, and in Dynamic call back it prints good in console, but i won't show gametext.

Here is code:


public OnPlayerPickUpPickup(playerid, pickupid){
for(new i = 1; i < sizeof(ePickupInfo); i++){
if(pickupid == ePickupInfo[i][epPID]){
printf("%d %d %d, %s", pickupid, ePickupInfo[i][epPID], ePickupInfo[i][epSQLID], ePickupInfo[i][epDiscription]);
format(globalstring, sizeof(globalstring), "%s", ePickupInfo[i][epDiscription]);
return GameTextForPlayer(playerid, globalstring, 3000, 5);
}
}
return true;
}

public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
for(new i = 1; i < sizeof(ePickupInfo); i++){
if(pickupid == ePickupInfo[i][epPID]){
printf("%d %d %d, %s", pickupid, ePickupInfo[i][epPID], ePickupInfo[i][epSQLID], ePickupInfo[i][epDiscription]);
format(globalstring, sizeof(globalstring), "%s", ePickupInfo[i][epDiscription]);
return GameTextForPlayer(playerid, globalstring, 3000, 5);
}
}
return 1;
}


I also tried GameTextForPlayer(playerid, ePickupInfo[i][epDiscription], 3000, 5);


I had " " (space) at end of that string...

Jhero
11/06/2012, 02:19 PM
Try this.

{
GameTextForPlayer(playerid, ePickupInfo[i][epDiscription], 500, 5);
}

CoaPsyFactor
11/06/2012, 02:55 PM
hm, what is difference ? I tried, its not showing :( in console it prints it right, but gametext doesn't show up :/

[NWA]Hannes
11/06/2012, 03:04 PM
Try this.

public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new i = 1; i < sizeof(ePickupInfo); i++)
{
if(pickupid == ePickupInfo[i][epPID])
{
new asdpickupstring[128];
format(asdpickupstring, 128, "%s", ePickupInfo[i][epDiscription]);
printf("%d %d %d, %s", pickupid, ePickupInfo[i][epPID], ePickupInfo[i][epSQLID], ePickupInfo[i][epDiscription]);
GameTextForPlayer(playerid, asdpickupstring, 3000, 5);
}
}
return 1;
}

public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
for(new i = 1; i < sizeof(ePickupInfo); i++)
{
if(pickupid == ePickupInfo[i][epPID])
{
new asdpickupstring[128];
format(asdpickupstring, 128, "%s", ePickupInfo[i][epDiscription]);
GameTextForPlayer(playerid, asdpickupstring, 3000, 5);
printf("%d %d %d, %s", pickupid, ePickupInfo[i][epPID], ePickupInfo[i][epSQLID], ePickupInfo[i][epDiscription]);
}
}
return 1;
}

CoaPsyFactor
11/06/2012, 03:11 PM
not working :'( I can not believe, it must be some stupid small error :D

CoaPsyFactor
11/06/2012, 03:45 PM
sorry for DP, but I found some weird thing, it shows ~y~LSPD ok, but ~y~Ukucajte /onduty ili /offduty doesn't show at all :/