10.07.2012, 17:59
Hello,
I'm having quite a weird problem with the statements in samp, it's the only time I've met it so far. It seems to be no error, no bug, but it only happens on this line.
I'm working on a command for my own house system, but as I said, I just can't understand how this problems occurs and why, whenever I check for the house coordinates to see if the player is near the entrance of a house, the code following will execute as normal and when the player is not near the house coordinates it won't execute which is also normal. But there comes the problem, I wan't to return a message to the player saying that he is not near the house's entrance when trying to buy the house, but even though the code following the statement doesn't execute, it doesn't execute the message either even though it's supposed to do so.
This is the code:
The thing is the return SendMsg(playerid,blabla,"some text"); just won't work when the player is away from a house. SendMsg is my shortened variant for SendClientMessage and it works perfectly ok.
Also, other things such as checking for the player's money works perfectly okay. Such as:
Hope someone can help, thanks.
I'm having quite a weird problem with the statements in samp, it's the only time I've met it so far. It seems to be no error, no bug, but it only happens on this line.
I'm working on a command for my own house system, but as I said, I just can't understand how this problems occurs and why, whenever I check for the house coordinates to see if the player is near the entrance of a house, the code following will execute as normal and when the player is not near the house coordinates it won't execute which is also normal. But there comes the problem, I wan't to return a message to the player saying that he is not near the house's entrance when trying to buy the house, but even though the code following the statement doesn't execute, it doesn't execute the message either even though it's supposed to do so.
This is the code:
Код:
if(!IsPlayerInRangeOfPoint(playerid,5.0,hData[hid][hEntX],hData[hid][hEntY],hData[hid][hEntZ])) return SendMsg(playerid,white,"You are not in the surroundings of a house.");
Also, other things such as checking for the player's money works perfectly okay. Such as:
Код:
if(GetPlayerMoney(playerid) < hData[hid][Price]) return SendMsg(playerid,white,"You don't have enough money to buy this house.");