Timer making player client crash
#1

Hi, I got a big problem, this function is supposed to draw gametexts for players who are next to the a defined place. It works perfectly for the different "for" statments but the "if" and "else if" statments make player client crash O.o, well, any idea why please?

Here is the func: http://pastebin.com/f2781704f
Here is what makes client crash, I have ni idea why
pawn Код:
if(PlayerToPoint(1.0, i, 362.0175,188.6333,1008.3828))
{
    GameTextForPlayer(i, "~w~Tapez~~r~/joblist ~w~Pour regarder les annonces de jobs", 3000, 3);
    return 1;
}
else if(PlayerToPoint(1.0, i, 1572.5874,-1675.6232,28.3955))
{
    GameTextForPlayer(i, "~w~Tapez~~r~/roof ~w~Pour descendre", 3000, 3);
    return 1;
}
else if(PlayerToPoint(1.0, i, 242.4418,66.3357,1003.6406))
{
    GameTextForPlayer(i, "~w~Tapez~~r~/roof ~w~Pour acceder au toit", 3000, 3);
     return 1;
}
else if(PlayerToPoint(1, i, 2315.5657,-11.3179,26.7422))
{
    GameTextForPlayer(i, "~w~Tapez~~r~/buy ~w~Pour afficher les produits en vente", 3000, 3);
    return 1;
}
else if (PlayerToPoint(1, i, 362.0175,188.6333,1008.3828))
{
    GameTextForPlayer(i, "~w~Tapez ~g~/help ~n~~w~Pour afficher les commandes liees a la banque.", 3000, 3);
    return 1;
}
Edit: I got new, sometimes instead of crashing client, when I go to the area (I don't know if it does the same with the other ones):
pawn Код:
else if(PlayerToPoint(1.0, i, 242.4418,66.3357,1003.6406))
{
    GameTextForPlayer(i, "~w~Tapez~~r~/roof ~w~Pour acceder au toit", 3000, 3);
     return 1;
}
It will display this gametext but with buggy characters:
pawn Код:
format(string, sizeof(string), "~w~Vous pouvez louer ce vehicule~n~Prix:~g~$%d~n~~w~Pour ce, tapez ~g~/rentcar~n~~w~pour sortir tapez ~r~/exit(ou F)",CarInfo[newcar][cValue]);
And this gametext is located under OnPlayerStateChange, wtf? O.o
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
     {
        new newcar = GetPlayerVehicleID(playerid);
        new string[256];if(IsRentable(newcar))
        {
          new hired;
          for(new p=0; p<MAX_PLAYERS; p++)
          {
            if (HireCar[p] == newcar)
                {
                    hired = 1;
                    break;
                }
            }
            if(hired == 0)
            {
                format(string, sizeof(string), "~w~Vous pouvez louer ce vehicule~n~Prix:~g~$%d~n~~w~Pour ce, tapez ~g~/rentcar~n~~w~pour sortir tapez ~r~/exit(ou F)",CarInfo[newcar][cValue]);
                TogglePlayerControllable(playerid, 0);
                GameTextForPlayer(playerid, string, 5000, 3);
                BrowsingCar[playerid] = 1;
                return 1;
            }
            else
            {
                SendClientMessage(playerid, GREY, "Ceci est un vйhicule de location. Malheureusement pour vous, il est dйjа louй.");
                return 1;
            }
        }
Seriously, I REALLY need this working and this freaking bug is uncommon, why does it display another gametext which has no relations with the other one

HELP PLEASE
Reply
#2

*bump*

Any help please? This is really urgent

Thanks in advance
Reply
#3

Fix the bad identitation please.
Reply
#4

Quote:
Originally Posted by MenaceX^
Fix the bad identitation please.
Done
Reply
#5

HEEEEEELP please
Reply
#6

You're using pre-defined strings, are you sure no one of them is empty?
Reply
#7

Quote:
Originally Posted by Coicatak
Quote:
Originally Posted by MenaceX^
Fix the bad identitation please.
Done
Not really.
Reply
#8

Quote:
Originally Posted by Rimeau
You're using pre-defined strings, are you sure no one of them is empty?
I'm not using any pre-defined strings for the if statements, only GameTextForPlayer, and PlayerToPoint... But as soon as I the message is supposed to appear, client crashes. (except for the 'for' statments, god know why, but I don't...)

Quote:
Originally Posted by MenaceX^
Quote:
Originally Posted by Coicatak
Quote:
Originally Posted by MenaceX^
Fix the bad identitation please.
Done
Not really.
It is on my screen, I think it is a resolution problem... Anyway here is the pastebin: http://pastebin.com/m54d51733 (I hope it will work, i've never used it before)

So any help?
Reply
#9

In which part are you getting crashes?
Reply
#10

Quote:
Originally Posted by MenaceX^
In which part are you getting crashes?
For every statments below the 'for' ones
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)