SA-MP Forums Archive
GameTextForPlayer not working - 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 working (/showthread.php?tid=349573)



GameTextForPlayer not working - CoaPsyFactor - 09.06.2012

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:

pawn Код:
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;
}



Re: GameTextForPlayer not working - JhnzRep - 09.06.2012

pawn Код:
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]);
            GameTextForPlayer(playerid, globalstring, 3000, 5);
        }
    }
    return 1;
}
Try This


Re: GameTextForPlayer not working - CoaPsyFactor - 09.06.2012

Not working, and I don't see any differences between these codes, you only removed return 1 after GameText


Re: GameTextForPlayer not working - ikey07 - 09.06.2012

As you use some globalstring, could be you format it somewhere else before, you should use new string, also why you use both dynamic and standart, like you wouldnt know what you use, also could be you arent assigned right pickup to ePickupInfo[i][epPID]


Re: GameTextForPlayer not working - CoaPsyFactor - 09.06.2012

It's not that, when I do all that in OnPlayerPickUpPicku it works fine ....