Problem with a loop
#1

Hey everyone, today i tried to make a loop to hide a textdraw, but it goes after a check for a variable, the thing is that it starts the "CustomizePlayer" function but it doesn't hide the textdraw. I know it will be an easy fix, but idk why I just can't see it.

Код:
public OnPlayerSpawn(playerid)
{
    StopAudioStreamForPlayer(playerid);
    if(pInfo[playerid][isCustomized] == false)
    {
        StartPlayerCustomization(playerid);
    }
    else if(pInfo[playerid][isCustomized])
    {
        //SetPlayerPos(playerid, Shelter_Spawn);
        SendClientMessage(playerid, -1, "Modificado");
        return 1;
    }
    for(new j; j < MAX_HOME_TDS; j++) PlayerTextDrawHide(playerid, homescr[j][playerid]);//This doesn't load!
    return 1;
}
Help!
Reply
#2

Add debug prints.
Reply
#3

Код:
public OnPlayerSpawn(playerid)
{
    StopAudioStreamForPlayer(playerid);
    print("Did this A");
    if(pInfo[playerid][isCustomized] == false)
    {
        StartPlayerCustomization(playerid);
        print("Did this B");
    }
    else if(pInfo[playerid][isCustomized])
    {
        //SetPlayerPos(playerid, Shelter_Spawn);
        SendClientMessage(playerid, -1, "Modificado");
        print("Did this C");
        return 1;
    }
    for(new j; j < MAX_HOME_TDS; j++) PlayerTextDrawHide(playerid, homescr[j][playerid]); print("Did this D");
    return 1;
}
Now it only prints "A", but it stills executes the "StartPlayerCustomization", without printing it though.
Reply
#4

Was "Did this B" printed? If not, add a print BEFORE StartPlayerCustomization also. If it prints before but not after, something in StartPlayerCustomization is causing a crash.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)