GameTextForPlayer not working
#1

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;
}
Reply
#2

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
Reply
#3

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

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]
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)