SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 29/12/2019, 09:20 PM   #1
MatusVietNam
Little Clucker
 
Join Date: Nov 2019
Posts: 44
Reputation: 0
Default Player's car

I want a player's car, after being exploded or damaged, the player quit the game and reconnected, the player's car is still in a broken state and in a place where it was broken before ?

Can anybody guide me on this?
MatusVietNam is offline   Reply With Quote
Old 29/12/2019, 11:12 PM   #2
Khodafez
Little Clucker
 
Join Date: Sep 2019
Location: Spain
Posts: 16
Reputation: 0
Default Re: Player's car

pawn Code:
new Float:vex,Float:vey,Float:vez,Float:vea, exploded[MAX_VEHICLES];

public OnVehicleDeath(vehicleid, killerid)
{
    GetVehiclePos(vehicleid,Float:vex,Float:vey,Float:vez);
    GetVehicleZAngle(vehicleid,Float:vea);
    exploded[vehicleid] = 1;
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    if(exploded[vehicleid] == 1)
    {
        SetVehiclePos(vehicleid, vex,vey,vez);
        SetVehicleZAngle(vehicleid, vea);
        SetVehicleHealth(vehicleid,450);
        exploded[vehicleid] = 0;
    }
    return 1;
}

I found this in an old Gamemode, I will search how we can make some parts of the car (like doors) be destroyed.
Khodafez is offline   Reply With Quote
Old 30/12/2019, 02:05 AM   #3
MatusVietNam
Little Clucker
 
Join Date: Nov 2019
Posts: 44
Reputation: 0
Default Re: Player's car

What I want here is that when the player's car plunges into the water, his car cannot recover to its original position such as / park where he parked his car.
MatusVietNam is offline   Reply With Quote
Old 30/12/2019, 08:21 AM   #4
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,161
Reputation: 73
Default Re: Player's car

sunken vehicles always respawns (consider it's death), so you have to change it's spawn-location by recreating vehicle.
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DM mode after a player dies, how to reset the player position resurrection. oppo1234 Scripting Help 22 29/11/2015 08:06 AM
how to use dini save online player in to file every time player enter or out Chrisli520 Scripting Help 1 31/10/2013 08:04 AM
CreatePlayer3DTextLabel attached to player, dissappears when player is out of stream range? ғαιιοцт Scripting Help 2 21/09/2012 07:36 PM
[Request] Set(Player)ObjectSize / Size parameters in Create(Player)Object [03]Garsino Help Archive 3 28/11/2010 06:12 PM


All times are GMT. The time now is 07:08 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.