Spawn vehicle when key is pressed
#1

So i am wondering how i can do this.
When player is entered specific place and enters specific command he gots in spec mode and vehicle spawns.(i know how to make this)

But i can make when he press KEY_LEFT spawns another car but old one deletes from that place?
Thanks i have tried some things but they crashed my server or didn't even worked.So i removed it.

Thanks.
Reply
#2

Create two new variable you can named it as u want for example :
new mVehicle[MAX_PLAYERS];
new nVehicle[MAX_PLAYERS];
// now go under any callback where u wanna to call ur function here i will like to call my function under onplayerenterindyanmicarea(or whatever it is) callback
//here u also need some conditions , here think i have an specified area name mzone
// here only for example
if(getPlayerDynamicArea(playerid,mZone))
{
if(pressedkey == LEFT)
{
nVehicle[playerid] = CreateVehicle(...);
DestroyVehicle(mVehicle[playerid]);
}
}
note : it is a example which i m giving n functions are differ from actual functions
Reply
#3

Okay and now i am a bit confused.
How script will know that mVehicle is old vehicle id?
Reply
#4

Check fsdebug.pwn in standard filterscript folder in default samp-server folder. Command /vsel is what you need
Reply
#5

Realy big thank you Matess
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)