07.03.2009, 16:03
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
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):
It will display this gametext but with buggy characters:
And this gametext is located under OnPlayerStateChange, wtf? O.o
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
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;
}
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;
}
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]);
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;
}
}
HELP PLEASE