Removing Player From Vehicle
#1

Hello , i have a bug in my Gamemode but i don't know how to fix it . I tried many of Car Owner Ship Fs . But they are bugged due to a bug in my Gamemode . The Bug is that when player enters into a vehicle and try to buy it or Don't buy the the script remove the player from vehicle but he again enters into the vehicle automatically (i mean without the animation of entering into car) . Following is my code of Buying Vehicle (when player successfully buy a vehicle).
PHP код:
                    GivePlayerMoney(playerid, -DealershipVehicles[GetPlayerVehicleID(playerid)][vPrice]);
                    
format(stringsizeof(string), "You have purchased a %s for $%d, for more help regarding your purchase, type /carhelp."GetVehicleName(GetPlayerVehicleID(playerid)), DealershipVehicles[GetPlayerVehicleID(playerid)][vPrice]);
                    
SendClientMessage(playeridYELLOWstring);
                    
RemovePlayerFromVehicle(playerid);
                    
TogglePlayerControllable(playerid1);
                    return 
1;
                } 
Reply
#2

Quote:
Originally Posted by Arxalan
Посмотреть сообщение
Hello , i have a bug in my Gamemode but i don't know how to fix it . I tried many of Car Owner Ship Fs . But they are bugged due to a bug in my Gamemode . The Bug is that when player enters into a vehicle and try to buy it or Don't buy the the script remove the player from vehicle but he again enters into the vehicle automatically (i mean without the animation of entering into car) . Following is my code of Buying Vehicle (when player successfully buy a vehicle).
PHP код:
                    GivePlayerMoney(playerid, -DealershipVehicles[GetPlayerVehicleID(playerid)][vPrice]);
                    
format(stringsizeof(string), "You have purchased a %s for $%d, for more help regarding your purchase, type /carhelp."GetVehicleName(GetPlayerVehicleID(playerid)), DealershipVehicles[GetPlayerVehicleID(playerid)][vPrice]);
                    
SendClientMessage(playeridYELLOWstring);
                    
RemovePlayerFromVehicle(playerid);
                    
TogglePlayerControllable(playerid1);
                    return 
1;
                } 
After the related player has bought the car , why you want to remove him from car ? why are you using RemovePlayerFromVehicle(playerid) ?

try removing that line
Reply
#3

Where did you put the code?

OnPlayerEnterVehicle?
Reply
#4

Quote:
Originally Posted by Arxalan
Посмотреть сообщение
Hello , i have a bug in my Gamemode but i don't know how to fix it . I tried many of Car Owner Ship Fs . But they are bugged due to a bug in my Gamemode . The Bug is that when player enters into a vehicle and try to buy it or Don't buy the the script remove the player from vehicle but he again enters into the vehicle automatically (i mean without the animation of entering into car) . Following is my code of Buying Vehicle (when player successfully buy a vehicle).
PHP код:
                    
                    SendClientMessage
(playeridYELLOWstring);
                    ------------->>>>>>
RemovePlayerFromVehicle(playerid);
                    
TogglePlayerControllable(playerid1);
                    return 
1;
                } 
Remove This Line
Reply
#5

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
Where did you put the code?

OnPlayerEnterVehicle?
OnDialogResponse.when he enter into a vehicle A Dialog appears and he can choose he wanna to buy it or not
Reply
#6

and Replace RemovePlayerFromVehicle(playerid) By ClearPlayerAnimation(playerid) in your codes
Reply
#7

Try this:
PHP код:
                   GivePlayerMoney(playerid, -DealershipVehicles[GetPlayerVehicleID(playerid)][vPrice]); 
                    
format(stringsizeof(string), "You have purchased a %s for $%d, for more help regarding your purchase, type /carhelp."GetVehicleName(GetPlayerVehicleID(playerid)), DealershipVehicles[GetPlayerVehicleID(playerid)][vPrice]); 
                    
SendClientMessage(playeridYELLOWstring); 
                    new 
Float:xFloat:yFloat:z;
                    
GetPlayerPos(playerid,x,y,z);
                    
SetPlayerPos(playerid,x,y,z);
                    return 
1
                } 
Reply
#8

Same bug . Now player get out of vehicle and enters into it directly (without animation).
Reply
#9

Quote:
Originally Posted by Arxalan
Посмотреть сообщение
Same bug . Now player get out of vehicle and enters into it directly (without animation).
Tried mine?
Reply
#10

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
Tried mine?
Yes yours.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)