SA-MP Forums Archive
Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help (/showthread.php?tid=309395)



Help - Twinki1993 - 07.01.2012

Well, I want to make a new thing in my script. I want that when player spawns, the script will make a vehicle and put him inside of it. How to do this? This is when dies too.


Re: Help - Konstantinos - 07.01.2012

pawn Код:
public OnPlayerSpawn(playerid)
{
    new sVehicle,
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, angle);
    sVehicle = CreateVehicle(411, x, y, z, angle, 6, 6, 60);
    return PutPlayerInVehicle(playerid, sVehicle, 0);
}



Re: Help - Twinki1993 - 07.01.2012

Hm thanks I will try it

BUmp
C:\Users\Maki\Desktop\server 0.3d\gamemodes\Tank DM.pwn(104) : error 017: undefined symbol "x"
C:\Users\Maki\Desktop\server 0.3d\gamemodes\Tank DM.pwn(105) : error 017: undefined symbol "angle"
C:\Users\Maki\Desktop\server 0.3d\gamemodes\Tank DM.pwn(106) : error 017: undefined symbol "x"


Re: Help - Konstantinos - 07.01.2012

Sorry!
pawn Код:
public OnPlayerSpawn(playerid)
{
    new sVehicle, Float:x, Float:y, Float:z, Float:angle;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, angle);
    sVehicle = CreateVehicle(411, x, y, z, angle, 6, 6, 60);
    return PutPlayerInVehicle(playerid, sVehicle, 0);
}



Re: Help - Twinki1993 - 07.01.2012

Thanks mate, this works.


Re: Help - Twinki1993 - 07.01.2012

But how to make that when he dies his vehicle dies too?


Re: Help - Konstantinos - 07.01.2012

Don't double post, there is Edit Button for this.
Can you explain what you mean. Do you want when player dies the vehicle does what?


Re: Help - Stigg - 07.01.2012

Try:
pawn Код:
DestroyVehicle(sVehicle);
https://sampwiki.blast.hk/wiki/DestroyVehicle


Re: Help - Twinki1993 - 07.01.2012

Thanks, and sorry for double posting.