Error please
#1

Code
PHP код:
CMD:muabaohiem(playeridparams[])
{
        if (!
IsPlayerInRangeOfPoint(playerid3.0, -2438.7168,506.1696,29.9401))
        return 
SendClientMessage(playeridCOLOR_GREY"Toan bo khu mua bao hiem da bi khoa, hay ra sfvip de mua baohiem.");
        if (
GetPlayerCash(playerid) >= 3000) {
        return 
SendClientMessage(playeridCOLOR_GREY"Khong du tien voi bao hiem nay.");
        
GivePlayerCash(playerid, -4000);
        
PlayerInfo[playerid][pInsurance] = 5;
        
SendClientMessageEx(playeridCOLOR_WHITE"   Mua bao hiem, ban da tra $40000 + mot muc phi chuyen nhuong mot lan $2,500, Ban se duoc chua tri o Benh Vien SF voi $1,500.");
        else if(
IsPlayerInRangeOfPoint(playerid,4.0,2785.5869142400.2248531240.531127) && PlayerInfo[playerid][pDonateRank] >= 3) {
        if (
GetPlayerCash(playerid) >= 3000) {
        if (
PlayerInfo[playerid][pInsurance] != 6) {
        
GivePlayerCash(playerid, -3000);
        
PlayerInfo[playerid][pInsurance] = 6;
        
SendClientMessageEx(playeridCOLOR_WHITE"   Da mua bao hiem , ban se duoc dieu tri tai VIP CLUB voi gia 500 moi luot.");
        }
        else {
        
SendClientMessageEx(playeridCOLOR_GRAD4"Ban da co bao hiem tai Club VIP!");
        }
        else {
        
SendClientMessageEx(playeridCOLOR_GRAD4"Ban khong co du tien de mua bao hiem nay!");
        return 
1;

I have alot of fatal error.
May i lost somethings, please help.
Reply
#2

Seems like you forgot to use brackets ({ })
Here is the fixed code, try this one:
pawn Код:
CMD:muabaohiem(playerid, params[])
{
    if (!IsPlayerInRangeOfPoint(playerid, 3.0, -2438.7168,506.1696,29.9401)) return SendClientMessage(playerid, COLOR_GREY, "Toan bo khu mua bao hiem da bi khoa, hay ra sfvip de mua baohiem.");
    if (GetPlayerCash(playerid) >= 3000) return SendClientMessage(playerid, COLOR_GREY, "Khong du tien voi bao hiem nay.");
    GivePlayerCash(playerid, -4000);
    PlayerInfo[playerid][pInsurance] = 5;
    SendClientMessageEx(playerid, COLOR_WHITE, "   Mua bao hiem, ban da tra $40000 + mot muc phi chuyen nhuong mot lan $2,500, Ban se duoc chua tri o Benh Vien SF voi $1,500.");
    if(IsPlayerInRangeOfPoint(playerid,4.0,2785.586914, 2400.224853, 1240.531127) && PlayerInfo[playerid][pDonateRank] >= 3)
    {
        if (GetPlayerCash(playerid) >= 3000)
        {
            if (PlayerInfo[playerid][pInsurance] != 6)
            {
                GivePlayerCash(playerid, -3000);
                PlayerInfo[playerid][pInsurance] = 6;
                SendClientMessageEx(playerid, COLOR_WHITE, "   Da mua bao hiem , ban se duoc dieu tri tai VIP CLUB voi gia 500 moi luot.");
            }
            else
            {
                SendClientMessageEx(playerid, COLOR_GRAD4, "Ban da co bao hiem tai Club VIP!");
                return 1;
            }
            else
            {
                SendClientMessageEx(playerid, COLOR_GRAD4, "Ban khong co du tien de mua bao hiem nay!");
                return 1;
            }
        }
    }      
    return 1;
}
Reply
#3

Post the errors and error lines
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)