SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 18/08/2010, 02:05 AM   #1
ShawnMiller1337
Big Clucker
 
Join Date: Jul 2010
Posts: 162
Reputation: 1
Default Spike strip Help

Hello all ,

Code:
	if (strcmp(cmd,"/createstrip",true) == 0)
	{
	    if(IsACop(playerid))
		{
			if(OnDuty[playerid] != 1)
			{
			    new Float:X,Float:Y,Float:Z,Float:A;
		        GetPlayerPos(playerid, X, Y, Z);
		        GetPlayerFacingAngle(playerid,A);
		        CreateStrip(X,Y,Z,A);
		        GetPlayerName(playerid, sendername, sizeof(sendername));
		        format(string, sizeof(string), "HQ: Officer %s has successfully deployed a spikestrip.", sendername);
		        SendTeamMessage(1, TEAM_BLUE_COLOR, string);
		        SendTeamMessage(99, TEAM_BLUE_COLOR, string);
		        
			}
		}
	    return 1;
	}
also

Code:
stock CreateStrip(Float:x,Float:y,Float:z,Float:Angle)
{
    for(new i = 0; i < sizeof(SpikeInfo); i++)
  	{
  	    if(SpikeInfo[i][sCreated] == 0)
  	    {
            SpikeInfo[i][sCreated]=1;
            SpikeInfo[i][sX]=x;
            SpikeInfo[i][sY]=y;
            SpikeInfo[i][sZ]=z-0.7;
            SpikeInfo[i][sObject] = CreateDynamicObject(2899, x, y, z-0.9, 0, 0, Angle-90);
	        return 1;
  	    }
  	}
  	return 0;
}
It works and everything , But when a vehicle drives over it , the TIRES don't blow out , any help ?
ShawnMiller1337 is offline  
Old 18/08/2010, 02:11 AM   #2
RealWorldGTA
Little Clucker
 
RealWorldGTA's Avatar
 
Join Date: Jul 2010
Posts: 11
Reputation: 0
Default Re: Spike strip Help

you have no function call to update the damage to the vehicles tires.

Code:
stock PopPlayerTires(playerid)
{
	new vehicleid = GetPlayerVehicleID(playerid);
	new panels, doors, lights, tires;
	GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
	UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, 15);
}
strongly suggest checking to ensure a player is in a vehicle before function call...

On an After Thought, you dont even have anything detecting if the player is in a vehicle, or if the vehicle is touching the object.. Someone released a SpikeStrip system a while back.. heres the Source: http://pastebin.com/W5d6WH1F

That options uses Pickups, theres another option for a very small area check ... but i would suggest pickups as you don't need a timer or ticker.
__________________
SAMP Hardware Bans Beta Release
http://realworldgta.com/
RealWorldGTA is offline  
Old 18/08/2010, 02:19 AM   #3
ShawnMiller1337
Big Clucker
 
Join Date: Jul 2010
Posts: 162
Reputation: 1
Default Re: Spike strip Help

Where would I put the PopPlayerTires function at , I added in the stock now what
ShawnMiller1337 is offline  
Old 18/08/2010, 02:20 AM   #4
PotH3Ad
Huge Clucker
 
Join Date: Jul 2008
Location: Westside - CA
Posts: 290
Reputation: 5
Default Re: Spike strip Help

You would need to run a loop to check if a player is in the distance of any of the spike strip objects, unless their is a more efficient way...
PotH3Ad is offline  
Old 18/08/2010, 02:22 AM   #5
RealWorldGTA
Little Clucker
 
RealWorldGTA's Avatar
 
Join Date: Jul 2010
Posts: 11
Reputation: 0
Default Re: Spike strip Help

lol, sorry i edited my reply, again, i dont suggest area check, its a waste of a timer, when a pickup is auto called on touch!
__________________
SAMP Hardware Bans Beta Release
http://realworldgta.com/
RealWorldGTA is offline  
Old 18/08/2010, 02:24 AM   #6
ShawnMiller1337
Big Clucker
 
Join Date: Jul 2010
Posts: 162
Reputation: 1
Default Re: Spike strip Help

Code:
C:\Documents and Settings\Owner\Desktop\SA-MP Server\gamemodes\RGv58.pwn(40332) : error 017: undefined symbol "GetVehicleDamageStatus"
C:\Documents and Settings\Owner\Desktop\SA-MP Server\gamemodes\RGv58.pwn(40334) : error 017: undefined symbol "UpdateVehicleDamageStatus"
ShawnMiller1337 is offline  
Old 18/08/2010, 02:28 AM   #7
PotH3Ad
Huge Clucker
 
Join Date: Jul 2008
Location: Westside - CA
Posts: 290
Reputation: 5
Default Re: Spike strip Help

Quote:
Originally Posted by RealWorldGTA View Post
lol, sorry i edited my reply, again, i dont suggest area check, its a waste of a timer, when a pickup is auto called on touch!
Yes, but he's using objects currently :P, but it is better to use pickups though, its more efficient, instead of running a loop every second...
PotH3Ad is offline  
Old 18/08/2010, 02:28 AM   #8
RealWorldGTA
Little Clucker
 
RealWorldGTA's Avatar
 
Join Date: Jul 2010
Posts: 11
Reputation: 0
Default Re: Spike strip Help

Shawn, ( Update your compiler libraries from the server files download. )

Pot, ( Yes he is, but an object has no interaction with a vehicle unles its solid and a player is jsut going to run into it...

The Source ( not my source ) from my post, creates the object ( hes already doing ), and 'pickups' ... any player is driving, and touches pickup, it sets the tire bits to 15, thus they are 'Popped' ... one COULD use an an area check based on temp coords of the object, the downfall is, a timer is needed in some format, in a loop...

If a timer can be avoided, one SHOULD avoid it hence the reason for the pickup, as its auto called when ANYONE touches it.

Save a Resource here, can allow more resources in places he may better serve their needs.
__________________
SAMP Hardware Bans Beta Release
http://realworldgta.com/
RealWorldGTA is offline  
 

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
[Map] [MAP]Drag Strip dallz Maps 9 25/07/2010 11:26 PM
[FilterScript] [FS]That spike strip everyone's been asking about [HLF]Southclaw Filterscripts 49 07/04/2010 04:13 PM
R5 Spike Strip gtapolicemods Help Archive 10 27/03/2010 03:21 AM
[FilterScript] [FS] DS=Drag Strip P1nd3r Filterscripts 13 19/01/2010 02:05 PM
strip function StrickenKid Help Archive 4 24/11/2009 03:34 AM


All times are GMT. The time now is 03:49 AM.


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