Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

[debug] Run time error 10: "Native function failed"

$
0
0
Hi..

HTML Code:

[18:30:32] [debug] Run time error 10: "Native function failed"
[18:30:32] [debug]  strmid
[18:30:32] [debug] AMX backtrace:
[18:30:32] [debug] #0 003d7050 in public pc_cmd_change (playerid=31, params[]=@002c2074 "firstcar 13 10000") at D:\GameMode RPG\gamemodes\grandlarc.pwn:53797


This is the command:

HTML Code:

CMD:change(playerid, params[])//Done
{
        if(PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_GREY, "* Trebuie sa detii level 3+ pentru a folosi aceasta comanda.");
        if(SwitchPlayer[playerid] < MAX_PLAYERS) return SendClientMessage(playerid, COLOR_GREY, "* Nu poti folosi acum aceasta comanda. Foloseste comanda (/cancel change) mai intai.");
        new item[12], player, price, string[128], A;
        if(GetPVarInt(playerid, "AccountLocked") == 1)
        {
                SendClientMessage( playerid, COLOR_WHITE, "{FFFFCC}Eroare: Contul tau este blocat. Tasteaza comanda (/unlockacc) pentru a il debloca si pentru a folosi aceasta comanda." );
                return 1;
        }
        if(sscanf(params, "s[12]ud", item, player, price)) return SendClientMessage(playerid, COLOR_GREY, "INFO: /change [firstcar/secondcar/thirdcar/fourthcar/house/business/garage/boat/helicopter/airplane] [playerid] [price]");
        if(player == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "No Such Player");
        if(player == playerid) return 1;
        if(SwitchPlayer[player] < MAX_PLAYERS) return SendClientMessage(player, COLOR_GREY, "* Nu poti folosi acum aceasta comanda. Foloseste comanda (/cancel change) mai intai.");
        if(PlayerInfo[player][pLevel] < 3) return SendClientMessage(player, COLOR_GREY, "* Trebuie sa detii level 3+ pentru a folosi aceasta comanda.");
        if(price < 10000 || price >
100000000) return SendClientMessage(playerid, COLOR_GREY, "* Suma trebuie sa fie intre 10.000 si 100.000.000$.");
        if(!ProxDetectorS(5.0, playerid, player))
        {
                if(FIXES_strcmp(item, "garage", false)) return SendClientMessage(playerid, COLOR_GREY, "* Persoana respectiva trebuie sa se afle in apropierea ta.");
        }
        if(!FIXES_strcmp(item, "garage", false))
        {
                        new bool:o1 = false, bool:o2 = false;
                        for(new i = 0; i < sizeof(GarageInfo); i++)
                        {
                                if(IsPlayerInRangeOfPoint(playerid, 2.0, GarageInfo[i][gEnterX], GarageInfo[i][gEnterY], GarageInfo[i][gEnterZ]))
                                {
                                        if(FIXES_strcmp(PlayerInfo[playerid][pName], GarageInfo[i][gOwner], true)) return SendClientMessage(playerid, COLOR_GREY, "* Garajul respectiv nu iti apartine.");
                                        o1 = true;
                                        SetPVarInt(playerid, "SwitchGarageID", i);
                                        break;
                                }
                        }
                        if(!o1) return SendClientMessage(player, COLOR_GREY, "* Persoana respectiva nu detine nici un garaj sau nu se afla in apropierea lui.");
                        for(new i = 0; i < sizeof(GarageInfo); i++)
                        {
                                if(IsPlayerInRangeOfPoint(player, 2.0, GarageInfo[i][gEnterX], GarageInfo[i][gEnterY], GarageInfo[i][gEnterZ]))
                                {
                                        if(FIXES_strcmp(PlayerInfo[player][pName], GarageInfo[i][gOwner], true)) return SendClientMessage(player, COLOR_GREY, "* Garajul respectiv nu iti apartine.");
                                        o2 = true;
                                        SetPVarInt(player, "SwitchGarageID", i);
                                        break;
                                }
                        }
                        if(!o2) return SendClientMessage(playerid, COLOR_GREY, "* Persoana respectiva nu detine nici un garaj sau nu se afla in apropierea lui.");
                        A = Switch_Garage;
        }
        else if(!FIXES_strcmp(item, "firstcar", false))
        {
                A = PlayerInfo[playerid][pFirstCar];
                if(A == 999) return SendClientMessage(playerid, COLOR_GREY, "* Nu esti proprietarul unui vehicul de tip First.");
                if(PlayerInfo[player][pFirstCar] == 999) return SendClientMessage(playerid, COLOR_GREY, "* Persoana respectiva nu detine un vehicul de tip First.");
                new vehicleid = GetPlayerVehicleID(playerid);
                if(!vehicleid) return SendClientMessage(playerid, COLOR_GREY, "* Trebuie sa te afli in vehiculul de tip First.");
                if(!AutoInfo[A][cStatus] || vehicleid != AutoInfo[A][cID]) return 1;
                A = Switch_First;
        }
        else if(!FIXES_strcmp(item, "secondcar", false))
        {
                A = PlayerInfo[playerid][pSecondCar];
                if(A == 999) return SendClientMessage(playerid, COLOR_GREY, "* Nu esti proprietarul unui vehicul de tip Second.");
                if(PlayerInfo[player][pSecondCar] == 999) return SendClientMessage(playerid, COLOR_GREY, "* Persoana respectiva nu detine un vehicul de tip Second.");
                new vehicleid = GetPlayerVehicleID(playerid);
                if(!vehicleid) return SendClientMessage(playerid, COLOR_GREY, "* Trebuie sa te afli in vehiculul de tip Second.");
                if(!AutoInfo[A][cStatus] || vehicleid != AutoInfo[A][cID]) return 1;
                A = Switch_Second;
        }
        else if(!FIXES_strcmp(item, "thirdcar", false))
        {
                A = PlayerInfo[playerid][pThirdCar];
                if(A == 999) return SendClientMessage(playerid, COLOR_GREY, "* Nu esti proprietarul unui vehicul de tip Third.");
                if(PlayerInfo[player][pThirdCar] == 999) return SendClientMessage(playerid, COLOR_GREY, "* Persoana respectiva nu detine un vehicul de tip Third.");
                new vehicleid = GetPlayerVehicleID(playerid);
                if(!vehicleid) return SendClientMessage(playerid, COLOR_GREY, "* Trebuie sa te afli in vehiculul de tip Third.");
                if(!AutoInfo[A][cStatus] || vehicleid != AutoInfo[A][cID]) return 1;
                A = Switch_Third;
        }
        else if(!FIXES_strcmp(item, "fourthcar", false))
        {
                if(!PlayerInfo[playerid][pVModel]) return SendClientMessage(playerid, COLOR_GREY, "* Nu esti proprietarul unui vehicul de tip Fourth.");
                if(!PlayerInfo[player][pVModel]) return SendClientMessage(playerid, COLOR_GREY, "* Persoana respectiva nu detine un vehicul de tip Fourth.");
                new vehicleid = GetPlayerVehicleID(playerid);
                if(!vehicleid) return SendClientMessage(playerid, COLOR_GREY, "* Trebuie sa te afli in vehiculul de tip Fourth.");
                if(vehicleid != FourthCar[playerid]) return 1;
                A = Switch_Fourth;
        }
        else if(!FIXES_strcmp(item, "house", false))
        {
                if(PlayerInfo[playerid][pHouseKey] == 999) return SendClientMessage(playerid, COLOR_GREY, "* Nu esti proprietarul unei locuinte.");
                if(PlayerInfo[player][pHouseKey] == 999) return SendClientMessage(playerid, COLOR_GREY, "* Persoana respectiva nu detine o locuinta.");
                new H1 = PlayerInfo[playerid][pHouseKey], H2 = PlayerInfo[player][pHouseKey];
                if(PlayerInfo[player][pLevel] < HouseInfo[H1][hLevel])
                {
                        format(string, sizeof(string), "* Trebuie sa detii level %d+ pentru a putea cumpara aceasta locuinta.", HouseInfo[H1][hLevel]);
                        return SendClientMessage(player, COLOR_GREY, string);
                }
                if(PlayerInfo[playerid][pLevel] < HouseInfo[H2][hLevel])
                {
                        format(string, sizeof(string), "* Trebuie sa detii level %d+ pentru a putea cumpara aceasta locuinta.", HouseInfo[H2][hLevel]);
                        return SendClientMessage(playerid, COLOR_GREY, string);
                }
                A = Switch_House;
        }
        else if(!FIXES_strcmp(item, "business", false))
        {
                if(PlayerInfo[playerid][pBizKey] == 999) return SendClientMessage(playerid, COLOR_GREY, "* Nu esti proprietarul unei firme.");
                if(PlayerInfo[player][pBizKey] == 999) return SendClientMessage(playerid, COLOR_GREY, "* Persoana respectiva nu detine o firma.");
                new B1 = PlayerInfo[playerid][pBizKey], B2 = PlayerInfo[player][pBizKey];
                if(PlayerInfo[player][pLevel] < BizzInfo[B1][bLevel])
                {
                        format(string, sizeof(string), "* Trebuie sa detii level %d+ pentru a putea cumpara aceasta firma.", BizzInfo[B1][bLevel]);
                        return SendClientMessage(player, COLOR_GREY, string);
                }
                if(PlayerInfo[playerid][pLevel] < BizzInfo[B2][bLevel])
                {
                        format(string, sizeof(string), "* Trebuie sa detii level %d+ pentru a putea cumpara aceasta firma.", BizzInfo[B2][bLevel]);
                        return SendClientMessage(playerid, COLOR_GREY, string);
                }
                A = Switch_Business;
        }
        else if(!FIXES_strcmp(item, "boat", false))
        {
                if(!PlayerInfo[playerid][pBoat]) return SendClientMessage(playerid, COLOR_GREY, "* Nu esti proprietarul unei barci.");
                if(!PlayerInfo[player][pBoat]) return SendClientMessage(playerid, COLOR_GREY, "* Persoana respectiva nu detine o barca.");
                A = Switch_Boat;
        }
        else if(!FIXES_strcmp(item, "airplane", false))
        {
                if(!PlayerInfo[playerid][pPlane]) return SendClientMessage(playerid, COLOR_GREY, "* Nu esti proprietarul unui avion.");
                if(!PlayerInfo[player][pPlane]) return SendClientMessage(playerid, COLOR_GREY, "* Persoana respectiva nu detine un avion.");
                A = Switch_Airplane;
        }
        else if(!FIXES_strcmp(item, "helicopter", false))
        {
                if(!PlayerInfo[playerid][pHeli]) return SendClientMessage(playerid, COLOR_GREY, "* Nu esti proprietarul unui elicopter.");
                if(!PlayerInfo[player][pHeli]) return SendClientMessage(playerid, COLOR_GREY, "* Persoana respectiva nu detine un elicopter.");
                A = Switch_Helicopter;
        }
        else return SendClientMessage(playerid, COLOR_GREY, "INFO: /change [firstcar/secondcar/thirdcar/fourthcar/house/business/boat/helicopter/airplane] [playerid] [price]");
        if(A == Switch_First) strmid(item, "Masina de tip First", 0, 32, 32);
        else if(A == Switch_Second) strmid(item, "Masina de tip Second", 0, 32, 32);
        else if(A == Switch_Third) strmid(item, "Masina de tip Third", 0, 32, 32);
        else if(A == Switch_Fourth) strmid(item, "Masina de tip Fourth", 0, 32, 32);
        else if(A == Switch_House) strmid(item, "Locuinta", 0, 32, 32);
        else if(A == Switch_Business) strmid(item, "Firma", 0, 32, 32);
        else if(A == Switch_Boat) strmid(item, "Barca", 0, 32, 32);
        else if(A == Switch_Airplane) strmid(item, "Avionul", 0, 32, 32);
        else if(A == Switch_Helicopter) strmid(item, "Elicopterul", 0, 32, 32);
        else if(A == Switch_Garage) strmid(item, "Garajul", 0, 32, 32);
        else return 1;
        format(string, sizeof(string), "* Vrei sa schimbi cu %s %s pentru suma de %d$.", PlayerInfo[player][pName], item, price);
        SendClientMessage(playerid, COLOR_LIGHTRED, string);
        SendClientMessage(playerid, COLOR_LIGHTRED, "* Foloseste comanda (/cancel change) pentru a anula schimbul.");
        format(string, sizeof(string), "* %s vrea sa schimbe cu tine %s pentru suma de %d$.", PlayerInfo[playerid][pName], item, price);
        SendClientMessage(player, COLOR_LIGHTRED, string);
        SendClientMessage(player, COLOR_LIGHTRED, "* Foloseste comanda (/accept change) pentru a accepta schimbul.");
        SwitchPlayer[playerid] = player;
        SwitchPlayer[player] = playerid;
        SwitchItem[playerid] = A;
        SwitchItem[player] = A;
        SwitchPrice[player] = price;
        return 1;
}


Viewing all articles
Browse latest Browse all 18226

Trending Articles