enter & exit bugg Text
#1

Hi, i did make something at /enter & /exit, first i was fixed, but now see i the text not?

pawn Код:
if (strcmp(cmd, "/enter", true) ==0)
{
    if(IsPlayerInRangeOfPoint(playerid, 4, HouseInfo[playerid][hEntrancex], HouseInfo[playerid][hEntrancey], HouseInfo[playerid][hEntrancez]))
    {
        SendClientMessage(playerid, COLOR_RED, "Press Enter or F to enter your house!");
    }
    if(IsPlayerInRangeOfPoint(playerid, 6, BusinessInfo[playerid][bEntrancex], BusinessInfo[playerid][bEntrancey], BusinessInfo[playerid][bEntrancez]))
    {
        SendClientMessage(playerid, COLOR_RED, "Press Enter or F to enter your Business!");
    }
    return 1;
}
i see the fault not? maybe you?
Reply
#2

An You have 2 if() statements (Might not be the problem)

the first if() will check the player point, if it is sucessfull it will send the message, however you are not returning anything, therefor it carry's on and checks if the player's at the buisness point, and if that if() fails, no message will be sent, if it is sucessfull, it will be.

pawn Код:
if (strcmp(cmd, "/enter", true) ==0)
{
if(IsPlayerInRangeOfPoint(playerid, 4, HouseInfo[playerid][hEntrancex], HouseInfo[playerid][hEntrancey], HouseInfo[playerid][hEntrancez]))
{
SendClientMessage(playerid, COLOR_RED, "Press Enter or F to enter your house!");
return 1; // starts at the beginning of the function
}
else if(IsPlayerInRangeOfPoint(playerid, 6, BusinessInfo[playerid][bEntrancex], BusinessInfo[playerid][bEntrancey], BusinessInfo[playerid][bEntrancez]))
{
SendClientMessage(playerid, COLOR_RED, "Press Enter or F to enter your Business!");
return 1; // starts at the beginning of the function
}
    return 1;
}
and if() statement checks if something is true/false, in this code you are not returning anything, so the code will just carry on through the next if().

you can use else if() to check something else if the first if() statement is unsucessfull, go and read through the if() functions on the SA-MP WIKI to get a better explanation.

https://sampwiki.blast.hk/wiki/Control_S...s#Conditionals

PS: I'm not a very good scripter, I am learning from my mistakes, so don't be shocked if it doesn't work.
Reply
#3

Uhm, if you type '/enter' then you get a message how to get in a house/biz?
Why not that you enter the house/biz?
wtf xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)