SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 09/05/2013, 12:43 PM   #1
AwokenNeoX
Big Clucker
 
Join Date: Oct 2012
Posts: 96
Reputation: -1
Cool Car Problem

Hi Guys,

I have a little Problem example if I use /car nrg. I spawn a NRG-500 but if I use this Command 10 times. I have 10 NRG. But I want that :

If nobody use the vehicle that it will be delte after 10 sec.

Can somone make a new function ?

Exp.

If Player is not in the spwaned Vehicle
Delete Vehicle after 10 Sec.


Thank you
AwokenNeoX is offline   Reply With Quote
Old 09/05/2013, 12:49 PM   #2
vvhy
Big Clucker
 
Join Date: Mar 2012
Posts: 145
Reputation: 11
Default Re: Car Problem

Show your command if you want me to do it. Otherwise just do this:

The place where you create the vehicle just do do this

pawn Code:
new veh = CreateVehicle(vID,pos[0],pos[1],pos[2]+3,pos[3],-1,-1,10);//change the last thing to 10 for 10 seconds.
__________________
My work:
__________________________________________________ ______
MAPS

House Interior
Bank Interior
vvhy is offline   Reply With Quote
Old 09/05/2013, 12:54 PM   #3
MrTinder
Big Clucker
 
Join Date: Sep 2012
Posts: 148
Reputation: 2
Default Re: Car Problem

Try this:

pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/car nrg", cmdtext, true, 10) == 0)
    {
        new Float:x, Float:y, Float:z, Float:a;
        GetPlayerFacingAngle(playerid, a);
        GetPlayerPos(playerid, x, y, z);
        new snrg = CreateVehicle(522, x, y, z, a+90, -1, -1, 0);
        return 1;
    }
    return 0;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(vehicleid == snrg)
    {
        SetTimer("KillVehicle", 10000, false);
    }
    return 1;
}

forward KillVehicle(vehicleid);
public KillVehicle(vehicleid)
{
    DestroyVehicle(snrg);
}
MrTinder is offline   Reply With Quote
Old 09/05/2013, 12:56 PM   #4
AwokenNeoX
Big Clucker
 
Join Date: Oct 2012
Posts: 96
Reputation: -1
Default AW: Car Problem

Thank you
AwokenNeoX 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
Problem converting gamemode to 0.3x, GetPlayerVersion problem? Tommy_Diaz Scripting Help 3 03/02/2013 10:27 PM
npc_record failed problem(not typical problem) [mmtech]DakoTa Scripting Help 7 10/07/2012 08:31 PM
[SOLVED] 3 problem's! (1 problem still unsolved, but stopped solving.) Mechscape Help Archive 9 24/12/2009 08:47 PM
Spawn Problem/Virtual World Problem Globe2009 Help Archive 5 05/11/2009 09:12 AM


All times are GMT. The time now is 11:30 AM.


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