/v park spawns a new car
#1

helow all eny one know how to fiz this issue when i do /apark or /v park i park my car but i get new car and my old ports to the old place and when i restart my server my car is at the first place wher i bouth is and at my park place is the new spavned car and i dont own it ?? eny one knows

PHP код:
 else if(strcmp(x_nr,"park",true) == 0)
            {
                new 
Float:x,Float:y,Float:z;
                new 
Float:a;
                new 
carid;
                new 
getcarid;
                if(
GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid PlayerInfo[playerid][pPcarkey]; }
                else if(
GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid PlayerInfo[playerid][pPcarkey2]; }
                else if(
GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid PlayerInfo[playerid][pPcarkey3]; }
                else { return 
1; }
                
getcarid GetPlayerVehicleID(playerid);
                
GetPlayerName(playeridplayernamesizeof(playername));
                
GetVehiclePos(caridxyz);
                
//GetPlayerFacingAngle(playerid, a);
                
GetVehicleZAngle(carida);
                if(
IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
                {
                       if(
PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 PlayerInfo[playerid][pPcarkey3])
                    {
                        
SendClientMessage(playeridCOLOR_GREY"Ti ne posedujes kola.");
                        return 
1;
                    }
                    if(
getcarid == carid)
                    {
                        
CarInfo[carid][cLocationx] = x;
                        
CarInfo[carid][cLocationy] = y;
                        
CarInfo[carid][cLocationz] = z;
                        
CarInfo[carid][cAngle] = a;
                        
format(stringsizeof(string), "~n~ Parkirali ste vase vozilo na ovoj lokaciji. ~n~");
                        
GameTextForPlayer(playerid"Parkirali ste vozilo na ovoj poziciji i ono ce se stvarati tu."100003);
      
OnPropUpdate();
                        
SacuvajIgraca(playerid);
                        
DestroyVehicle(carid);
                        
CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
                    
JBC_TogglePlayerControllable(playerid1);
                        return 
1;
                       }
                }
            } 
is the issue here or somevher alse
Reply
#2

maybe you used
pawn Код:
new carid;
somewhere else in script for create a vehicle :&
or try with removing this like i did
pawn Код:
else if(strcmp(x_nr,"park",true) == 0)
            {
                new Float:x,Float:y,Float:z;
                new Float:a;
                new carid;
                new getcarid;
                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; }
                else { return 1; }
                getcarid = GetPlayerVehicleID(playerid);
                GetPlayerName(playerid, playername, sizeof(playername));
                GetVehiclePos(carid, x, y, z);
                //GetPlayerFacingAngle(playerid, a);
                GetVehicleZAngle(carid, a);
                if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
                {
                       if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 & PlayerInfo[playerid][pPcarkey3])
                    {
                        SendClientMessage(playerid, COLOR_GREY, "Ti ne posedujes kola.");
                        return 1;
                    }
                    if(getcarid == carid)
                    {
                        CarInfo[carid][cLocationx] = x;
                        CarInfo[carid][cLocationy] = y;
                        CarInfo[carid][cLocationz] = z;
                        CarInfo[carid][cAngle] = a;
                        format(string, sizeof(string), "~n~ Parkirali ste vase vozilo na ovoj lokaciji. ~n~");
                        GameTextForPlayer(playerid, "Parkirali ste vozilo na ovoj poziciji i ono ce se stvarati tu.", 10000, 3);
      OnPropUpdate();
                        SacuvajIgraca(playerid);
                        DestroyVehicle(carid);
                        //CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);  //REMOVE THIS ONE JUST FOR TEST
                    JBC_TogglePlayerControllable(playerid, 1);
                        return 1;
                       }
                }
            }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)