Some errors
#1

pawn Код:
forward LogVehicleTransfer(seller[],buyer[],sellprice[],senderid);
16236-public LogVehicleTransfer(seller[],buyer[],sellprice[],senderid)
{
    new str[512];
    new clean_sellprice[64];
    new clean_name[MAX_PLAYER_NAME];
    new clean_oname[MAX_PLAYER_NAME];
    mysql_real_escape_string(seller,clean_name);
    mysql_real_escape_string(buyer,clean_oname);
    mysql_real_escape_string(sellprice,clean_sellprice);
    format(str,sizeof(str),"INSERT INTO rp_vehicle_transfer_logs (seller,buyer,price) VALUES ('%s','%s','%d')",clean_name,clean_oname,clean_sellprice);
    mysql_query(str,player_threads_alt[sellerid]);
   
}

12863-LogVehicleTransfer(oname,name,sellprice,playerid);
pawn Код:
C:\Users\Filip\Desktop\SERVER\gamemodes\rp.pwn(12863) : error 035: argument type mismatch (argument 3)
C:\Users\Filip\Desktop\SERVER\gamemodes\rp.pwn(16236) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

Why did you put [] in the forward/public ? you should add it only when it's a string.. and in that case it's an int.
pawn Код:
forward LogVehicleTransfer(seller, buyer, sellprice, senderid);
public LogVehicleTransfer(seller, buyer, sellprice, senderid)
{
    new str[512];
    new clean_sellprice[64];
    new clean_name[MAX_PLAYER_NAME];
    new clean_oname[MAX_PLAYER_NAME];
    mysql_real_escape_string(seller,clean_name);
    mysql_real_escape_string(buyer,clean_oname);
    mysql_real_escape_string(sellprice,clean_sellprice );
    format(str,sizeof(str),"INSERT INTO rp_vehicle_transfer_logs (seller,buyer,price) VALUES ('%s','%s','%d')",clean_name,clean_oname,clean_sel lprice);
    mysql_query(str,player_threads_alt[sellerid]);
}

LogVehicleTransfer(oname,name,sellprice,playerid);
Reply
#3

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
Why did you put [] in the forward/public ? you should add it only when it's a string.. and in that case it's an int.
mysql_real_escape_string uses an array (string) for the 1st and 2nd parameters, so changing them to integers will give warnings about tag mismatches.

---

The 3rd parameter should be an integer and you used it as an array.

pawn Код:
stock LogVehicleTransfer(seller[], buyer[], sellprice, senderid)
{
    new str[512], clean_name[MAX_PLAYER_NAME], clean_oname[MAX_PLAYER_NAME];
    mysql_real_escape_string(seller, clean_name);
    mysql_real_escape_string(buyer, clean_oname);
    format(str, sizeof(str), "INSERT INTO rp_vehicle_transfer_logs (seller,buyer,price) VALUES ('%s','%s',%d)", clean_name, clean_oname, sellprice);
    mysql_query(str, player_threads_alt[sellerid]);
}
By the way, you don't use senderid anywhere. Are you sure the the sellerid wasn't supposed to be the senderid?

pawn Код:
LogVehicleTransfer(oname, name, sellprice, playerid);
Make sure the parameters are:
oname -> string
name -> string
sellprice -> integer
playerid -> integer
Reply
#4

pawn Код:
new other2 = vehicle_sell_sender[playerid];
            new sellprice = vehicle_sell_price[playerid];
            new slot = vehicle_sell_offer[playerid];
            new str2[256];
            new name[MAX_PLAYER_NAME];
            new oname[MAX_PLAYER_NAME];
            GetCharacterName(playerid,name);
            GetCharacterName(other2,oname);
            if(response == 1)
            {

                if(GetDistanceBetweenPlayers(playerid,other2) < 7.5)
                {

                    if(CharacterInfo[playerid][active_character[playerid]][cMoney] >= sellprice)
                    {

                        format(str2,sizeof(str2),"Ai acceptat oferta lui %s pentru vehicul.",oname);
                        SendClientMessageA(playerid,COLOR_FACTION,str2);
                        format(str2,sizeof(str2),"%s a acceptat oferta in legatura cu vehiculul tau!",name);
                        SendClientMessageA(other2,COLOR_FACTION,str2);
                        VehicleInfo[slot][vOwner] = CharacterInfo[playerid][active_character[playerid]][cID];
                        format(VehicleInfo[slot][vOwnerName],MAX_PLAYER_NAME,"%s",name);
                        CharacterInfo[playerid][active_character[playerid]][cMoney] -= sellprice;
                        CharacterInfo[other2][active_character[other2]][cMoney] += sellprice;
                        PlayerPlaySound(playerid,1054,0.0,0.0,0.0);
                        PlayerPlaySound(other2,1054,0.0,0.0,0.0);
                        format(str2,sizeof(str2),"ia contractul de vanzare-cumparare si il indreapta catre %s pentru a-l semna.",oname);
                        SendEmote(other2,str2);
                        format(str2,sizeof(str2),"semneaza contractul..");
                        SendEmote(playerid,str2);
                        LogVehicleTransfer(oname,name,sellprice,playerid);

                    }
                    else
                    {

                        SendClientMessage(playerid,COLOR_GREY,"Nu ai destui bani pentru a cumpara acest vehicul.");

                    }

                }
                else
                {

                    SendClientMessage(playerid,COLOR_GREY,"Nu esti langa acel player.");

                }

            }

pawn Код:
C:\Users\Filip\Desktop\SERVER\gamemodes\rp.pwn(16242) : error 017: undefined symbol "sellerid"
C:\Users\Filip\Desktop\SERVER\gamemodes\rp.pwn(16236) : warning 203: symbol is never used: "senderid"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#5

Quote:
Originally Posted by Jony_Cruze
Посмотреть сообщение
pawn Код:
C:\Users\Filip\Desktop\SERVER\gamemodes\rp.pwn(16242) : error 017: undefined symbol "sellerid"
C:\Users\Filip\Desktop\SERVER\gamemodes\rp.pwn(16236) : warning 203: symbol is never used: "senderid"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
By the way, you don't use senderid anywhere. Are you sure the the sellerid wasn't supposed to be the senderid?
Change:
pawn Код:
mysql_query(str, player_threads_alt[sellerid]);
to:
pawn Код:
mysql_query(str, player_threads_alt[senderid]);
Reply
#6

pawn Код:
[17:56:12] Error for query: INSERT INTO rp_vehicle_transfer_logs (seller,buyer,price) VALUES ('Rakeem Lowell','Jonathan Brooklyn',1)
in database i have table :

id sell buyer price
Reply
#7

I assume the field is wrong. It should be sell instead of seller.

so change to:
pawn Код:
format(str, sizeof(str), "INSERT INTO rp_vehicle_transfer_logs (sell,buyer,price) VALUES ('%s','%s',%d)", clean_name, clean_oname, sellprice);
Reply
#8

pawn Код:
stock LogVehicleTransfer(seller[], buyer[], sellprice[], senderid)
{

    new str[512];
    new clean_sellprice[64];
    new clean_name[MAX_PLAYER_NAME];
    new clean_oname[MAX_PLAYER_NAME];
    mysql_real_escape_string(sellprice,clean_sellprice);
    mysql_real_escape_string(seller,clean_name);
    mysql_real_escape_string(buyer,clean_oname);
    format(str,sizeof(str),"INSERT INTO rp_vehicle_transfer_logs (seller,buyer,price) VALUES ('%s','%s','%s')",clean_name,clean_oname,clean_sellprice);
    mysql_query(str,player_threads_alt[senderid]);

}

pawn Код:
new other2 = vehicle_sell_sender[playerid];
            new sellingprice = vehicle_sell_price[playerid];
            new slot = vehicle_sell_offer[playerid];
            new str2[256];
            new name[MAX_PLAYER_NAME];
            new oname[MAX_PLAYER_NAME];
            GetCharacterName(playerid,name);
            GetCharacterName(other2,oname);
            if(response == 1)
            {

                if(GetDistanceBetweenPlayers(playerid,other2) < 7.5)
                {

                    if(CharacterInfo[playerid][active_character[playerid]][cMoney] >= sellingprice)
                    {

                        format(str2,sizeof(str2),"Ai acceptat oferta lui %s pentru vehicul.",oname);
                        SendClientMessageA(playerid,COLOR_FACTION,str2);
//                      new vehicleid = GetPlayerVehicleID(playerid);
                        format(str2,sizeof(str2),"%s a acceptat oferta in legatura cu vehiculul tau!",name);
                        SendClientMessageA(other2,COLOR_FACTION,str2);
                        VehicleInfo[slot][vOwner] = CharacterInfo[playerid][active_character[playerid]][cID];
                        format(VehicleInfo[slot][vOwnerName],MAX_PLAYER_NAME,"%s",name);
                        CharacterInfo[playerid][active_character[playerid]][cMoney] -= sellingprice;
                        CharacterInfo[other2][active_character[other2]][cMoney] += sellingprice;
                        PlayerPlaySound(playerid,1054,0.0,0.0,0.0);
                        PlayerPlaySound(other2,1054,0.0,0.0,0.0);
                        format(str2,sizeof(str2),"ia contractul de vanzare-cumparare si il indreapta catre %s pentru a-l semna.",oname);
                        SendEmote(other2,str2);
                        format(str2,sizeof(str2),"semneaza contractul..");
                        SendEmote(playerid,str2);
                        //LogVehicleTransfer(oname,name,vehicleid,sellprice);
error line                      LogVehicleTransfer(oname,name,sellingprice,playerid);

                    }
                    else
                    {

                        SendClientMessage(playerid,COLOR_GREY,"Nu ai destui bani pentru a cumpara acest vehicul.");

                    }

                }
where is the problem here?

because i got this

pawn Код:
C:\Users\Filip\Desktop\SERVER\gamemodes\rp.pwn(12865) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#9

Read my first post and you'll understand. I told you to change the sellprice from an array you had to an integer. And you used the first code with the only difference the stock instead of forward/public.

The solution is above, read it.
Reply
#10

Solved , i got this problem crash server it's urgent !! pls help it's not from logvehicle !

pawn Код:
[19:24:31] [debug] Server crashed while executing rp.amx
[19:24:31] [debug] AMX backtrace:
[19:24:31] [debug] #0 0011e320 in PlayerUpdateListener (playerid=44) at C:\Users\asd\Desktop\SERVER\gamemodes\rp.pwn:27580
[19:24:31] [debug] #1 0004c774 in public CrashListener () at C:\Users\asd\Desktop\SERVER\gamemodes\rp.pwn:5841
[19:24:31] [debug] System backtrace:
[19:24:31] [debug] #0 f6be035b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[19:24:31] [debug] #1 f6bd9389 in _ZN11crashdetect20PrintSystemBacktraceEPv () from plugins/crashdetect.so
[19:24:31] [debug] #2 f6bdb8ed in _ZN11crashdetect11OnExceptionEPv () from plugins/crashdetect.so
[19:24:31] [debug] #3 f6bdfe68 in ?? () from plugins/crashdetect.so
[19:24:31] [debug] #4 f77fe410 in ?? ()
[19:24:31] [debug] #5 080c9c47 in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
[19:24:31] [debug] #6 080cba55 in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
[19:24:31] [debug] #7 f6be219f in amx_Exec () from plugins/crashdetect.so
[19:24:31] [debug] #8 f6bdbdab in _ZN11crashdetect9DoAmxExecEPii () from plugins/crashdetect.so
[19:24:31] [debug] #9 f6bde457 in ?? () from plugins/crashdetect.so
[19:24:31] [debug] #10 080dc115 in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
[19:24:31] [debug] #11 080b5cfb in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
[19:24:31] [debug] #12 080b14d3 in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
[19:24:31] [debug] #13 f751ee46 in __libc_start_main () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
[19:24:31] [debug] #14 0804b521 in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
pawn Код:
public CrashListener()
{

    for(new i = 0; i < MAX_PLAYERS; i ++)
    {

        if(IsPlayerConnected(i) && !IsPlayerNPC(i)) PlayerUpdateListener(i);
//here      if(IsPlayerConnectedEx(i))
        {

            if(IsPlayerInAnyVehicle(i) && !crash_detection_disabled[i])
            {

                new veh = GetPlayerVehicleID(i);
                new Float:hp;
                GetVehicleHealth(veh,hp);
                if(hp < crash_vhp[veh])
                {
                    new Float:difference;
                    difference = (crash_vhp[veh] - hp);
                    if(difference > 100)
                    {

                        new Float:speed_x, Float:speed_y, Float:speed_z;
                        GetVehicleVelocity(GetPlayerVehicleID(i),speed_x,speed_y,speed_z);
                        new Float:final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*99.4166672; // 250.666667 = kmph  // 199,4166672 = mph
                        new speed = floatround(final_speed,floatround_round);
                        if(speed < player_vehicle_speed[i])
                        {
                            new Float:sdifference;
                            sdifference = (player_vehicle_speed[i] - speed);
                            if(sdifference > 20)
                            {

                                new drunk_gain = 4000;
                                if(seatbelt[i]) { drunk_gain = 3000; }
                                SetPlayerDrunkLevel(i,(GetPlayerDrunkLevel(i) + drunk_gain));
                                if(difference > 100)
                                {
                                    new Float:phploss;
                                    phploss = floatround((difference / 4));
                                    if(seatbelt[i]) { phploss = floatround(phploss / 2); if(phploss < 0) { phploss = 0; } }
                                    new Float:php;
                                    GetPlayerHealth(i,php);
                                    SetPlayerHealth(i,(php - phploss));
                                }
                                TextDrawShowForPlayer(i,crash_screen);
                                SetTimerEx("HideCrash",250,0,"i",i);

                            }

                        }

                    }

                }

            }
            if(!speedcamera_cooldown[i] && GetPlayerState(i) == PLAYER_STATE_DRIVER)
            {
                for(new a = 0; a < sizeof(speed_cameras); a ++)
                {

                    if(IsPlayerInRangeOfPoint(i,30.0,speed_cameras[a][0],speed_cameras[a][1],speed_cameras[a][2]))
                    {

                        if(player_vehicle_speed[i] >= 61)
                        {

                            if(!InCopCar(i) && !InAmbulance(i) && !IsAircraft(GetPlayerVehicleID(i)) && GetVehicleModel(GetPlayerVehicleID(i)) != 407)
                            {

                                new Float:X, Float:Y, Float:Z;
                                GetPlayerPos(i,X,Y,Z);
                                new name[MAX_PLAYER_NAME];
                                GetCharacterNameEx(i,name);
                                new str[256];
                                format(str,sizeof(str),"** FLASH ** Radarul a facut o poza asupra vehiculului lui %s",name);
                                SendServerEmote(str,X, Y, Z, 30.0, 0);
                                speedcamera_cooldown[i] = 60;
                                printf("Inainte de banca si amenda!");
                                if(CharacterInfo[i][active_character[i]][cBank] >= 420) { CharacterInfo[i][active_character[i]][cBank] -= 420; FactionInfo[0][fBank] += 420; CharacterInfo[i][active_character[i]][cSpeedTicket] += 420; }
                                printf("Dupa banca si amenda!");
                                PlayerPlaySound(i,1132,0.0,0.0,0.0);
                                if(speed_camera_stats[a] == -1)
                                {

                                    X = speed_cameras[a][0];
                                    Y = speed_cameras[a][1];
                                    GetPosInFrontOfCoord(X, Y, speed_cameras[a][2], 2.0);
                                    speed_camera_flash[a] = CreateObject(18670,X, Y,(speed_cameras[a][2] + 4.5),0.0,0.0,0.0);
                                    speed_camera_stats[a] = 3;

                                }
                            }
                        }
                    }
                }
            }
            // Buildings
            for(new h = 0; h < sizeof(InteriorInfo); h++)
            {
            new string[128];
            if(IsPlayerInRangeOfPoint(i,1.5,InteriorInfo[h][iSpawnX], InteriorInfo[h][iSpawnY], InteriorInfo[h][iSpawnZ]))
            {
                format(string, sizeof(string), "%s", InteriorInfo[h][iNames]);
                GameTextForPlayer(i, string, 2000, 3);
                }
            }
            new weapons[13][2];
            for(new a = 0; a < 13; a ++) { GetPlayerWeaponData(i,a,weapons[a][0],weapons[a][1]); }
            if((weapons[5][0] == WEAPON_AK47 && weapons[5][1] > 0 && GetPlayerWeapon(i) != WEAPON_M4 && GetPlayerWeapon(i) != WEAPON_AK47) || (weapons[5][0] == WEAPON_M4 && weapons[5][1] > 0 && GetPlayerWeapon(i) != WEAPON_M4 && GetPlayerWeapon(i) != WEAPON_AK47))
            {

                if(!cl_SlotUsed(i,CLOTHING_HIDEWEAPON))
                {

                    new object = (weapons[5][0] == WEAPON_M4) ? 356 : 355;
                    cl_SetClothing(i,CLOTHING_HIDEWEAPON,object,15,-0.2,0.15,0.0,0.0,45.0,0.0,1.0,1.0,1.0);

                }

            }
            else if(cl_SlotUsed(i,CLOTHING_HIDEWEAPON) && (GetPlayerWeapon(i) == WEAPON_M4 || GetPlayerWeapon(i) == WEAPON_AK47 || (!HasWeapon(i,WEAPON_M4) && !HasWeapon(i,WEAPON_AK47))))
            {

                cl_RemoveClothing(i,CLOTHING_HIDEWEAPON);

            }
            if((weapons[3][0] == WEAPON_SHOTGUN && weapons[3][1] > 0 && GetPlayerWeapon(i) != WEAPON_SHOTGUN && GetPlayerWeapon(i) != 27) || (weapons[3][0] == 27 && weapons[3][1] > 0 && GetPlayerWeapon(i) != 27 && GetPlayerWeapon(i) != WEAPON_SHOTGUN))
            {

                if(!cl_SlotUsed(i,CLOTHING_HIDEWEAPONTWO))
                {

                    new object = (weapons[3][0] == WEAPON_SHOTGUN) ? 349 : 351;
                    cl_SetClothing(i,CLOTHING_HIDEWEAPONTWO,object,15,-0.10,0.15,-0.35,0.0,-40.0,0.0,1.0,1.0,1.0);

                }

            }
            else if(cl_SlotUsed(i,CLOTHING_HIDEWEAPONTWO) && (GetPlayerWeapon(i) == WEAPON_SHOTGUN || GetPlayerWeapon(i) == 27 || (!HasWeapon(i,WEAPON_SHOTGUN))))
            {

                cl_RemoveClothing(i,CLOTHING_HIDEWEAPONTWO);

            }
        }
    }

    for(new b = 0; b < MAX_VEHICLES; b ++) { new Float:hp; GetVehicleHealth(b,hp); crash_vhp[b] = hp; }

}

pawn Код:
stock PlayerUpdateListener(playerid)
{

    /*new Float:armor;
    GetPlayerArmour(playerid,armor);
    if(armor > 0.0)
    {

        if(!armor_display_enabled[playerid] && armor_display_tog[playerid])
        {

            armor_display_enabled[playerid] = 1;

        }


    }
    else if(armor <= 0.0)
    {

        if(armor_display_enabled[playerid])
        {

            armor_display_enabled[playerid] = 0;

        }

    }*/

    if(driving_test[playerid] && driving_test_reversing[playerid])
    {

        new key, leftright, updown;
        GetPlayerKeys(playerid,key,updown,leftright);
        if(key == KEY_UP)
        {

            driving_test_failed[playerid] = 1;

        }

    }
    if(spraying_vehicle[playerid])
    {

        new key, leftright, updown;
        GetPlayerKeys(playerid,key,updown,leftright);
        if(leftright == KEY_RIGHT)
        {

            new newcol = (spraying_vehicle_color[playerid] + 1);
            if(newcol > 0 && newcol < 255)
            {

                spraying_vehicle_color[playerid] ++;
                RefreshSprayPos(playerid);
                PlayerPlaySound(playerid,1083,0.0,0.0,0.0);

            }
            else
            {

                PlayerPlaySound(playerid,1085,0.0,0.0,0.0);

            }

        }
        else if(leftright == KEY_LEFT)
        {

            new newcol = (spraying_vehicle_color[playerid] - 1);
            if(newcol > 0 && newcol < 255)
            {

                spraying_vehicle_color[playerid] --;
                RefreshSprayPos(playerid);
                PlayerPlaySound(playerid,1083,0.0,0.0,0.0);

            }
            else
            {

                PlayerPlaySound(playerid,1085,0.0,0.0,0.0);

            }

        }
        else if(key == KEY_SPRINT)
        {

            new slot = GetVehicleSlot(GetPlayerVehicleID(playerid));
            if(slot > -1)
            {
                if(spraying_vehicle[playerid] == 1)
                {

                    VehicleInfo[slot][vColor1] = spraying_vehicle_color[playerid];
                    SendClientMessage(playerid,COLOR_GREEN,"Prima culoare setata , alege-o pe ceea secundara.");
                    spraying_vehicle[playerid] = 2;

                }
                else
                {

                    VehicleInfo[slot][vColor2] = spraying_vehicle_color[playerid];
                    spraying_vehicle[playerid] = 0;
                    spraying_vehicle_color[playerid] = 0;
                    SendClientMessage(playerid,COLOR_GREEN,"Vehiculul tau a fost revopsit.");
                    leave_spray[playerid] = 1;

                }
            }
        }

    }
    if(vehicle_showroom_position[playerid] > -1)
    {

        if(donator_vehicle_purchasing[playerid] == -1)
        {
            new key, leftright, updown;
            GetPlayerKeys(playerid,key,updown,leftright);
            if(leftright == KEY_RIGHT)
            {

                new tmp = FetchNextVehiclePosition(playerid,vehicle_showroom_type[playerid]);
                if(tmp != -1) { vehicle_showroom_position[playerid] = tmp; } else { PlayerPlaySound(playerid,1085,0.0,0.0,0.0); }
                RefreshPlayerShowroomPosition(playerid);
                PlayerPlaySound(playerid,1083,0.0,0.0,0.0);

            }
            else if(leftright == KEY_LEFT)
            {

                new tmp = FetchPrevVehiclePosition(playerid,vehicle_showroom_type[playerid]);
                if(tmp != -1) { vehicle_showroom_position[playerid] = tmp; } else { PlayerPlaySound(playerid,1085,0.0,0.0,0.0); }
                RefreshPlayerShowroomPosition(playerid);
                PlayerPlaySound(playerid,1083,0.0,0.0,0.0);

            }
            else if(key == KEY_SPRINT && !(key & KEY_WALK))
            {

                if(vehicle_select_cooldown[playerid] == 0)
                {
                    new vehicle = vehicle_showroom_position[playerid];
                    new price = VehicleModelInfo[vehicle][vmPrice];
                    if(CharacterInfo[playerid][active_character[playerid]][cMoney] >= price || IsDonatorVehicle(VehicleModelInfo[vehicle][vmModel]))
                    {

                        if(NumberOfVehicles(playerid) < 3)
                        {

                            if(CharacterInfo[playerid][active_character[playerid]][cFaction] == 0 || CharacterInfo[playerid][active_character[playerid]][cFactionPermissions] != FAC_PERM_LEAD)
                            {

                                if(CanBuyVehicle(playerid) && !VehicleModelInfo[vehicle][vmEmerVeh] && !VehicleModelInfo[vehicle][vmNews])
                                {

                                    RefreshVehicleColorScreen(playerid);

                                }
                                else
                                {

                                    SendClientMessageA(playerid,COLOR_LIGHTRED,"Nu poti cumpara acest vehicul.");

                                }

                            }
                            else if(CharacterInfo[playerid][active_character[playerid]][cFactionPermissions] == FAC_PERM_LEAD)
                            {

                                if(CanBuyVehicle(playerid))
                                {

                                    ShowPlayerDialog(playerid,DIALOG_BUYFAC,DIALOG_STYLE_MSGBOX,"Ai dori sa o cumperi pentru factiune?","Poti cumpara acest vehicul pentru factiune , doresti asta?","Da","Nu");

                                }
                                else
                                {

                                    SendClientMessageA(playerid,COLOR_LIGHTRED,"Nu poti cumpara acest vehicul.");

                                }

                            }
                            else
                            {

                                if(CanBuyVehicle(playerid))
                                {

                                    RefreshVehicleColorScreen(playerid);

                                }
                                else
                                {

                                    SendClientMessageA(playerid,COLOR_LIGHTRED,"Nu poti cumpara acest vehicul.");

                                }

                            }

                        }
                        else
                        {

                            SendClientMessageA(playerid,COLOR_LIGHTRED,"Ai ajuns la nivelul maxim de vehicule(3 max)");

                        }

                    }
                    else
                    {

                        SendClientMessageA(playerid,COLOR_LIGHTRED,"Nu ai destui bani pentru a cumpara acest vehicul");
                        PlayerPlaySound(playerid,1085,0.0,0.0,0.0);

                    }

                }
            }
        }

    }
    if(choosing_character[playerid])
    {
        new key, leftright, updown;
        GetPlayerKeys(playerid,key,updown,leftright);
        if(leftright == KEY_RIGHT)
        {

            new tmp = (character_offset[playerid] + 1);
            if(tmp < NumberOfCharacters(playerid))
            {
                character_offset[playerid] ++;
                RefreshCharSelection(playerid,character_offset[playerid]);
                PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
            }
            else
            {
                PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
            }
        }
        else if(leftright == KEY_LEFT)
        {
            new tmp = (character_offset[playerid] - 1);
            if(tmp >= 0)
            {
                character_offset[playerid] --;
                RefreshCharSelection(playerid,character_offset[playerid]);
                PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
            }
            else
            {
                PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
            }
        }
        else if(key == KEY_SPRINT)
        {

            active_character[playerid] = character_offset[playerid];
            choosing_character[playerid] = false;
            SetPlayerName(playerid,CharacterInfo[playerid][active_character[playerid]][cName]);
            //herecharacter_chosen[playerid] = true;
            ProcessSpawn(playerid);
            LoadNotes(playerid);
            LoadInventory(playerid);
            LoadRingtone(playerid);
            format(accent[playerid],16,"%s",CharacterInfo[playerid][active_character[playerid]][cAccent]);
            SetPlayerHealth(playerid,CharacterInfo[playerid][active_character[playerid]][cHealth]);
            SetPlayerArmour(playerid,CharacterInfo[playerid][active_character[playerid]][cArmor]);
            character_offset[playerid] = 0;

        }
    }
    /**************SPIKES*************/
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        for(new i = 0; i < sizeof(SpikeInfo); i++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
            {
                if(SpikeInfo[i][sCreated] == 1)
                {
                    new panels, doors, lights, tires;
                    new carid = GetPlayerVehicleID(playerid);
                    GetVehicleDamageStatus(carid, panels, doors, lights, tires);
                    tires = encode_tires(1, 1, 1, 1);
                    UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
                }
            }
        }
    }
    /***********END SPIKES************/

}

pawn Код:
public IsPlayerConnectedEx(playerid)
{

    if(IsPlayerConnected(playerid) && character_chosen[playerid]) { return true; }
    return false;

}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)