Wrongly place bracket(i think)
#1

Hello, I'm making a delivery command but i'mhaving some problems with it.. When i Complie i get all kinds of errors that dont have anything to do with the command :S So my guess is a missplaced bracket.
Hope you can help me find it cuz i couldnt :/
pawn Код:
if(strcmp(cmd, "/loadheroin", true) == 0)
    {
        if(PlayerInfo[playerid][pDelLic] == 0)
        {
            if(PlayerInfo[playerid][DrugDelivery] == 0)
            {
                new tmpcar = GetPlayerVehicleID(playerid);
                if(IsPlayerInRangeOfPoint(playerid, 15, -2172.7830,-215.0502,35.3203))
                {
                    if(GetVehicleModel(tmpcar) == 433 || GetVehicleModel(tmpcar) == 440 || GetVehicleModel(tmpcar) == 514 || GetVehicleModel(tmpcar) == 428 || GetVehicleModel(tmpcar) == 403 || GetVehicleModel(tmpcar) == 515)
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You are delivering without a Valid Delivery License!");
                        SendClientMessage(playerid, COLOR_WHITE, "Get cought by a gang or mafia and you end up in alot of trubble!");
                        PlayerInfo[playerid][DrugDelivery] = 1;
                        SafeGivePlayerMoney(playerid, -2500);
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You can't load with this vehicle!");
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_WHITE, "You are not in the heroin loading place.");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "You Allready have drug delivery! Go unload them at Los Santos heroin place");
                return 1;
            }
        }
    }
    if(PlayerInfo[playerid]{pDelLic] == 1)
    {
        if(PlayerInfo[playerid][DrugDelivery] == 0)
        {
            new tmpcar = GetPlayerVehicleID(playerid);
            if(IsPlayerInRangeOfPoint(playerid, 15, -2172.7830,-215.0502,35.3203))
            {
                if(GetVehicleModel(tmpcar) == 433 || GetVehicleModel(tmpcar) == 440 || GetVehicleModel(tmpcar) == 514 || GetVehicleModel(tmpcar) == 428 || GetVehicleModel(tmpcar) == 403 || GetVehicleModel(tmpcar) == 515)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "You have started your delivery.");
                    PlayerInfo[playerid][DrugDelivery] = 1;
                    SafeGivePlayerMoney(playerid, -2500);
                }
                else
                {
                    SendClientMessage(playerid, COLOR_WHITE, "You can't load with this vehicle!");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "You are not in the heroin loading place.");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "You Allready have drug delivery! Go unload them at Los Santos heroin place");
            return 1;
        }
    }
EDIT: Just remembered that i added this too! Maybe that is causing it(this is just the part i added not whole command)
pawn Код:
if(IsAMafia(giveplayerid)) {
                        format(string, sizeof(string), "Illegal Delivery License: %s", text8);
                        SendClientMessage(giveplayerid, COLOR_GREY, string);
                    }
                    else
                    {
Reply
#2

Can u please paste the errors ?
Reply
#3

Try this:
pawn Код:
if(strcmp(cmd, "/loadheroin", true) == 0)
{
    if(PlayerInfo[playerid][pDelLic] == 0)
    {
        if(PlayerInfo[playerid][DrugDelivery] == 0)
        {
            new tmpcar = GetPlayerVehicleID(playerid);
            if(IsPlayerInRangeOfPoint(playerid, 15, -2172.7830,-215.0502,35.3203))
            {
                if(GetVehicleModel(tmpcar) == 433 || GetVehicleModel(tmpcar) == 440 || GetVehicleModel(tmpcar) == 514 || GetVehicleModel(tmpcar) == 428 || GetVehicleModel(tmpcar) == 403 || GetVehicleModel(tmpcar) == 515)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "You are delivering without a Valid Delivery License!");
                    SendClientMessage(playerid, COLOR_WHITE, "Get cought by a gang or mafia and you end up in alot of trubble!");
                    PlayerInfo[playerid][DrugDelivery] = 1;
                    SafeGivePlayerMoney(playerid, -2500);
                }
                else
                {
                    SendClientMessage(playerid, COLOR_WHITE, "You can't load with this vehicle!");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "You are not in the heroin loading place.");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "You Allready have drug delivery! Go unload them at Los Santos heroin place");
            return 1;
        }
    }
    else
    {
        if(PlayerInfo[playerid][DrugDelivery] == 0)
        {
            new tmpcar = GetPlayerVehicleID(playerid);
            if(IsPlayerInRangeOfPoint(playerid, 15, -2172.7830,-215.0502,35.3203))
            {
                if(GetVehicleModel(tmpcar) == 433 || GetVehicleModel(tmpcar) == 440 || GetVehicleModel(tmpcar) == 514 || GetVehicleModel(tmpcar) == 428 || GetVehicleModel(tmpcar) == 403 || GetVehicleModel(tmpcar) == 515)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "You have started your delivery.");
                    PlayerInfo[playerid][DrugDelivery] = 1;
                    SafeGivePlayerMoney(playerid, -2500);
                }
                else
                {
                    SendClientMessage(playerid, COLOR_WHITE, "You can't load with this vehicle!");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "You are not in the heroin loading place.");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "You Allready have drug delivery! Go unload them at Los Santos heroin place");
            return 1;
        }
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by LilBob
Посмотреть сообщение
Can u please paste the errors ?
The errors dont make sense. I get 26 errors that got nothing to do with the command :/

Quote:
Originally Posted by HurtLocker
Посмотреть сообщение
Try this:
pawn Код:
if(strcmp(cmd, "/loadheroin", true) == 0)
{
    if(PlayerInfo[playerid][pDelLic] == 0)
    {
        if(PlayerInfo[playerid][DrugDelivery] == 0)
        {
            new tmpcar = GetPlayerVehicleID(playerid);
            if(IsPlayerInRangeOfPoint(playerid, 15, -2172.7830,-215.0502,35.3203))
            {
                if(GetVehicleModel(tmpcar) == 433 || GetVehicleModel(tmpcar) == 440 || GetVehicleModel(tmpcar) == 514 || GetVehicleModel(tmpcar) == 428 || GetVehicleModel(tmpcar) == 403 || GetVehicleModel(tmpcar) == 515)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "You are delivering without a Valid Delivery License!");
                    SendClientMessage(playerid, COLOR_WHITE, "Get cought by a gang or mafia and you end up in alot of trubble!");
                    PlayerInfo[playerid][DrugDelivery] = 1;
                    SafeGivePlayerMoney(playerid, -2500);
                }
                else
                {
                    SendClientMessage(playerid, COLOR_WHITE, "You can't load with this vehicle!");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "You are not in the heroin loading place.");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "You Allready have drug delivery! Go unload them at Los Santos heroin place");
            return 1;
        }
    }
    else
    {
        if(PlayerInfo[playerid][DrugDelivery] == 0)
        {
            new tmpcar = GetPlayerVehicleID(playerid);
            if(IsPlayerInRangeOfPoint(playerid, 15, -2172.7830,-215.0502,35.3203))
            {
                if(GetVehicleModel(tmpcar) == 433 || GetVehicleModel(tmpcar) == 440 || GetVehicleModel(tmpcar) == 514 || GetVehicleModel(tmpcar) == 428 || GetVehicleModel(tmpcar) == 403 || GetVehicleModel(tmpcar) == 515)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "You have started your delivery.");
                    PlayerInfo[playerid][DrugDelivery] = 1;
                    SafeGivePlayerMoney(playerid, -2500);
                }
                else
                {
                    SendClientMessage(playerid, COLOR_WHITE, "You can't load with this vehicle!");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "You are not in the heroin loading place.");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "You Allready have drug delivery! Go unload them at Los Santos heroin place");
            return 1;
        }
    }
    return 1;
}
Ok thanks i will try it out
EDIT: Still the same. Here are all the errors i get
Код:
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(3636) : error 004: function "SafeSetPlayerPos" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(3746) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(3775) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(4308) : error 017: undefined symbol "GetVehicleName"
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(4308) : warning 202: number of arguments does not match definition
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(4324) : error 004: function "IsASalesVehicle" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(4328) : error 004: function "GetVehiclePrice" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(4423) : error 004: function "SafeSetPlayerPos" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(4428) : error 004: function "SafeSetPlayerPos" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(4433) : error 004: function "SafeSetPlayerPos" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(4438) : error 004: function "SafeSetPlayerPos" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(6405) : error 004: function "ClearChatbox" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(6472) : error 004: function "ClearChatbox" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(6958) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(6998) : error 004: function "SafeResetPlayerWeapons" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(7027) : error 004: function "SafeGivePlayerWeapon" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(7075) : error 004: function "SaveGuns" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(7079) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(7083) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(7087) : error 004: function "UpdatePlayerPosition" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(7193) : error 004: function "SafeSetPlayerPos" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(7194) : error 004: function "SafeSetPlayerInterior" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(7203) : error 004: function "SafeSetPlayerPos" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(7204) : error 004: function "SafeSetPlayerInterior" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(7236) : error 004: function "RemoveRoadblock" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(7287) : error 004: function "SafeSetPlayerPos" is not implemented
C:\Users\new account\Desktop\Europe Roleplay\gamemodes\larp.pwn(7293) : error 004: function "SafeSetPlayerPos" is not implemented

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
But i now think that the problem is this
pawn Код:
if(IsAMafia(giveplayerid)) {
                        format(string, sizeof(string), "Illegal Delivery License: %s", text8);
                        SendClientMessage(giveplayerid, COLOR_GREY, string);
                    }
Whole Command
pawn Код:
if(strcmp(cmd,"/showlicenses",true)==0 || strcmp(cmd,"/sl",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /showlicenses [playerid/PartOfName]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    if (ProxDetectorS(8.0, playerid, giveplayerid))
                    {
                        if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Show Licenses to yourself, use /licenses!"); return 1; }
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        new text0[20];
                        new text1[20];
                        new text2[20];
                        new text3[20];
                        new text4[20];
                        new text5[20];
                        new text6[20];
                        new text7[20];
                        new text8[20];
                        if(PlayerInfo[playerid][pPassport]) { text0 = "Approved"; } else { text1 = "Not Approved"; }
                        if(PlayerInfo[playerid][pCarLic]) { text1 = "Passed"; } else { text1 = "Not Passed"; }
                        if(PlayerInfo[playerid][pFlyLic]) { text2 = "Passed"; } else { text2 = "Not Passed"; }
                        if(PlayerInfo[playerid][pBoatLic]) { text3 = "Passed"; } else { text3 = "Not Passed"; }
                        if(PlayerInfo[playerid][pFishLic]) { text4 = "Passed"; } else { text4 = "Not Passed"; }
                        if(PlayerInfo[playerid][pGunLic]) { text5 = "Passed"; } else { text5 = "Not Passed"; }
                        if(PlayerInfo[playerid][pCopLic]) { text6 = "Passed"; } else { text6 = "Not Passed"; }
                        if(PlayerInfo[playerid][pArmyLic]) { text7 = "Passed"; } else { text7 = "Not Passed"; }
                        if(PlayerInfo[playerid][pDelLic]) { text8 = "Valid"; } else { text8 = "Invalid-Tax him!"; }
                        format(string, sizeof(string), "|__________ Licenses of %s __________|", sendername);
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                        format(string, sizeof(string), "Passport Documents: %s.", text0);
                        SendClientMessage(giveplayerid, COLOR_GREY, string);
                        format(string, sizeof(string), "Drivers License: %s.", text1);
                        SendClientMessage(giveplayerid, COLOR_GREY, string);
                        format(string, sizeof(string), "Flying License: %s.", text2);
                        SendClientMessage(giveplayerid, COLOR_GREY, string);
                        format(string, sizeof(string), "Sailing License: %s.", text3);
                        SendClientMessage(giveplayerid, COLOR_GREY, string);
                        format(string, sizeof(string), "Fishing License: %s.", text4);
                        SendClientMessage(giveplayerid, COLOR_GREY, string);
                        format(string, sizeof(string), "Weapon License: %s.", text5);
                        SendClientMessage(giveplayerid, COLOR_GREY, string);
                        format(string, sizeof(string), "Officer License: %s.", text6);
                        SendClientMessage(giveplayerid, COLOR_GREY, string);
                        format(string, sizeof(string), "|______ Special Licenses of %s ______|", sendername);
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                        format(string, sizeof(string), "Army Education: %s.", text7);
                        SendClientMessage(giveplayerid, COLOR_GREY, string);
                        format(string, sizeof(string), "* %s has shown his Licenses to you.", sendername);
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                        format(string, sizeof(string), "* You have shown your Licenses to %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                        if(IsAMafia(giveplayerid)) {
                        format(string, sizeof(string), "Illegal Delivery License: %s", text8);
                        SendClientMessage(giveplayerid, COLOR_GREY, string);
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   That player is not near you !");
                        return 1;
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   That player is Offline !");
                return 1;
            }
        }
        return 1;
    }
Reply
#5

(Couldnt edit my post :S ) Can i do like this?
pawn Код:
if(IsAMafia(giveplayerid)) {
                        format(string, sizeof(string), "Illegal Delivery License: %s", text8);
                        SendClientMessage(giveplayerid, COLOR_GREY, string);
                    }
or is it that whats giving me errors??
PS: That is in the /showlicenses command
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)