#1

Код:
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Publics/OnCommand.pwn(5695) : warning 209: function "cmd_v" should return a value
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Publics/OnCommand.pwn(5696) : error 010: invalid function or declaration





pawn Код:
}
        else if(!strcmp(x_vehicle, "buygps"))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                if(sscanf(params,"s[10]", x_vehicle))
                {
                    SendClientMessage(playerid, COLOR_INFO, "USAGE: /v buygps [level]");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl1: $150");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl2: $300");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl3: $450");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl4: $600");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl5: $750");
                    return 1;
                }
                new plname[MAX_PLAYER_NAME];
                GetPlayerName(playerid, plname, sizeof(plname));
                new gps;
                gps = strval(tmp);
                new vehicle = GetPlayerVehicleID(playerid);
                if(gps < 1 || gps > 5) { SendClientMessage(playerid, COLOR_INFO, "GPS level can't be below 1 or above 5 !"); return 1; }
                if(VehicleInfo[vehicle][vGPS] >= gps) { format(string, sizeof(string), "You already own a GPS level %d or more !", gps); SendClientMessage(playerid, COLOR_LIGHTRED, string); return 1; }
                new gpscost = gps*150;
                /*if(VehicleInfo[vehicle][vOwned] == 0)
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "You don't own this vehicle");
                     return 1;
                }*/

                new playername[MAX_PLAYER_NAME];
                GetPlayerName(playerid, playername, sizeof(playername));
                if(VehicleInfo[vehicle][vKey] == PlayerInfo[playerid][pCarKey] || (strcmp(plname, VehicleInfo[vehicle][vOwner], true) == 0))
                {
                    if(GetPlayerCash(playerid) >= gpscost)
                    {
                        format(string, sizeof(string), "You have succefully brought GPS level %d for $%d.", gps, gpscost);
                        SendClientMessage(playerid, COLOR_GREEN, string);
                        GivePlayerCash(playerid, -gpscost);
                        VehicleInfo[vehicle][vGPS] = gps;
                        SaveVehicles(playerid, vehicle);
                        return 1;
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_LIGHTRED, "You can not afford this");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_LIGHTRED, "You don't own this vehicle !");
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "You are not in a vehicle !");
                    return 1;
                }
            }
line 5695   }
line 5696}  return 1;
}
Reply
#2

pawn Код:
else if(!strcmp(x_vehicle, "buygps"))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                if(sscanf(params,"s[10]", x_vehicle))
                {
                    SendClientMessage(playerid, COLOR_INFO, "USAGE: /v buygps [level]");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl1: $150");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl2: $300");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl3: $450");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl4: $600");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl5: $750");
                    return 1;
                }
                new plname[MAX_PLAYER_NAME];
                GetPlayerName(playerid, plname, sizeof(plname));
                new gps;
                gps = strval(tmp);
                new vehicle = GetPlayerVehicleID(playerid);
                if(gps < 1 || gps > 5) { SendClientMessage(playerid, COLOR_INFO, "GPS level can't be below 1 or above 5 !"); return 1; }
                if(VehicleInfo[vehicle][vGPS] >= gps) { format(string, sizeof(string), "You already own a GPS level %d or more !", gps); SendClientMessage(playerid, COLOR_LIGHTRED, string); return 1; }
                new gpscost = gps*150;
                /*if(VehicleInfo[vehicle][vOwned] == 0)
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "You don't own this vehicle");
                     return 1;
                }*/

                new playername[MAX_PLAYER_NAME];
                GetPlayerName(playerid, playername, sizeof(playername));
                if(VehicleInfo[vehicle][vKey] == PlayerInfo[playerid][pCarKey] || (strcmp(plname, VehicleInfo[vehicle][vOwner], true) == 0))
                {
                    if(GetPlayerCash(playerid) >= gpscost)
                    {
                        format(string, sizeof(string), "You have succefully brought GPS level %d for $%d.", gps, gpscost);
                        SendClientMessage(playerid, COLOR_GREEN, string);
                        GivePlayerCash(playerid, -gpscost);
                        VehicleInfo[vehicle][vGPS] = gps;
                        SaveVehicles(playerid, vehicle);
                        return 1;
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_LIGHTRED, "You can not afford this");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_LIGHTRED, "You don't own this vehicle !");
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "You are not in a vehicle !");
                    return 1;
                }
          }
          return 1;
    }
}
Reply
#3

pawn Код:
}
        else if(!strcmp(x_vehicle, "buygps"))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                if(sscanf(params,"s[10]", x_vehicle))
                {
                    SendClientMessage(playerid, COLOR_INFO, "USAGE: /v buygps [level]");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl1: $150");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl2: $300");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl3: $450");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl4: $600");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl5: $750");
                    return 1;
                }
                new plname[MAX_PLAYER_NAME];
                GetPlayerName(playerid, plname, sizeof(plname));
                new gps;
                gps = strval(tmp);
                new vehicle = GetPlayerVehicleID(playerid);
                if(gps < 1 || gps > 5) { SendClientMessage(playerid, COLOR_INFO, "GPS level can't be below 1 or above 5 !"); return 1; }
                if(VehicleInfo[vehicle][vGPS] >= gps) { format(string, sizeof(string), "You already own a GPS level %d or more !", gps); SendClientMessage(playerid, COLOR_LIGHTRED, string); return 1; }
                new gpscost = gps*150;
                /*if(VehicleInfo[vehicle][vOwned] == 0)
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "You don't own this vehicle");
                     return 1;
                }*/

                new playername[MAX_PLAYER_NAME];
                GetPlayerName(playerid, playername, sizeof(playername));
                if(VehicleInfo[vehicle][vKey] == PlayerInfo[playerid][pCarKey] || (strcmp(plname, VehicleInfo[vehicle][vOwner], true) == 0))
                {
                    if(GetPlayerCash(playerid) >= gpscost)
                    {
                        format(string, sizeof(string), "You have succefully brought GPS level %d for $%d.", gps, gpscost);
                        SendClientMessage(playerid, COLOR_GREEN, string);
                        GivePlayerCash(playerid, -gpscost);
                        VehicleInfo[vehicle][vGPS] = gps;
                        SaveVehicles(playerid, vehicle);
                        return 1;
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_LIGHTRED, "You can not afford this");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_LIGHTRED, "You don't own this vehicle !");
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "You are not in a vehicle !");
                    return 1;
                }
            }
        }
        return 1;
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by FireCat
Посмотреть сообщение
pawn Код:
}
        else if(!strcmp(x_vehicle, "buygps"))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                if(sscanf(params,"s[10]", x_vehicle))
                {
                    SendClientMessage(playerid, COLOR_INFO, "USAGE: /v buygps [level]");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl1: $150");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl2: $300");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl3: $450");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl4: $600");
                    SendClientMessage(playerid, COLOR_INFO, "Lvl5: $750");
                    return 1;
                }
                new plname[MAX_PLAYER_NAME];
                GetPlayerName(playerid, plname, sizeof(plname));
                new gps;
                gps = strval(tmp);
                new vehicle = GetPlayerVehicleID(playerid);
                if(gps < 1 || gps > 5) { SendClientMessage(playerid, COLOR_INFO, "GPS level can't be below 1 or above 5 !"); return 1; }
                if(VehicleInfo[vehicle][vGPS] >= gps) { format(string, sizeof(string), "You already own a GPS level %d or more !", gps); SendClientMessage(playerid, COLOR_LIGHTRED, string); return 1; }
                new gpscost = gps*150;
                /*if(VehicleInfo[vehicle][vOwned] == 0)
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "You don't own this vehicle");
                     return 1;
                }*/

                new playername[MAX_PLAYER_NAME];
                GetPlayerName(playerid, playername, sizeof(playername));
                if(VehicleInfo[vehicle][vKey] == PlayerInfo[playerid][pCarKey] || (strcmp(plname, VehicleInfo[vehicle][vOwner], true) == 0))
                {
                    if(GetPlayerCash(playerid) >= gpscost)
                    {
                        format(string, sizeof(string), "You have succefully brought GPS level %d for $%d.", gps, gpscost);
                        SendClientMessage(playerid, COLOR_GREEN, string);
                        GivePlayerCash(playerid, -gpscost);
                        VehicleInfo[vehicle][vGPS] = gps;
                        SaveVehicles(playerid, vehicle);
                        return 1;
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_LIGHTRED, "You can not afford this");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_LIGHTRED, "You don't own this vehicle !");
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "You are not in a vehicle !");
                    return 1;
                }
            }
        }
        return 1;
    }
    return 1;
}
I get this then

Код:
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Publics/OnCommand.pwn(5695) : warning 209: function "cmd_v" should return a value
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Publics/OnCommand.pwn(5696) : error 010: invalid function or declaration
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Publics/OnCommand.pwn(5698) : error 010: invalid function or declaration
Reply
#5

Quote:
Originally Posted by N0FeaR
Посмотреть сообщение
I get this then

Код:
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Publics/OnCommand.pwn(5695) : warning 209: function "cmd_v" should return a value
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Publics/OnCommand.pwn(5696) : error 010: invalid function or declaration
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Publics/OnCommand.pwn(5698) : error 010: invalid function or declaration
For the 1st error you are missing a bracket
Reply
#6

Quote:
Originally Posted by vassilis
Посмотреть сообщение
For the 1st error you are missing a bracket
I cant see where is missing ?
Reply
#7

Quote:
Originally Posted by N0FeaR
Посмотреть сообщение
I get this then

Код:
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Publics/OnCommand.pwn(5695) : warning 209: function "cmd_v" should return a value
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Publics/OnCommand.pwn(5696) : error 010: invalid function or declaration
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Publics/OnCommand.pwn(5698) : error 010: invalid function or declaration
Show me the whole command.
Reply
#8

Quote:
Originally Posted by FireCat
Посмотреть сообщение
Show me the whole command.
I upload it on pastebin cus is so huge

http://pastebin.com/rBUMFu6W
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)