SA-MP Forums Archive
R5 Spike Strip - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: R5 Spike Strip (/showthread.php?tid=136418)



R5 Spike Strip - gtapolicemods - 25.03.2010

Has anybody made a script with the spike strip that is compatible with the new R5 spike strip tire popping features.





Re: R5 Spike Strip - Norn - 25.03.2010

It's easily done, although i'm not just going to give you the code.

Atleast attempt it.


Re: R5 Spike Strip - XGh0stz - 25.03.2010

Uh... Ok, well this is brand new & know nothing of it & didnt even notice it when reviewing R5 Features, but I guess the best way to test this is to put in a spike trap object & run over it to test if that much works...

He's not asking for a code, just a how to, even a simple function (If one exisits) would suffice

Closest clue to this task I've seen though:
pawn Код:
forward OnVehicleDamageStatusUpdate(vehicleid, playerid);
native GetVehicleDamageStatus(vehicleid, &panels, &doors, &lights, &tires);
native UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);



Re: R5 Spike Strip - Donny_k - 25.03.2010

Get the area of the spike object and update the vehicles tire damage if it's in the area.


Re: R5 Spike Strip - cessil - 25.03.2010

here's what I came up with in a couple of minutes, don't ask me to improve it because I won't you can edit it yourself

Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("spike strip filter script by cessil");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
  if (!strcmp("/repair", cmdtext))
  {
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
    RepairVehicle(GetPlayerVehicleID(playerid));
    SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
    return 1;
  }
  if (!strcmp("/pop", cmdtext))
  {
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
    UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), 0, 0, 0, encode_tires(1, 1, 1, 1));
    SendClientMessage(playerid, 0xFFFFFFFF, "popped tires?");
    return 1;
  }
  if (!strcmp("/dmg", cmdtext))
  {
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
    new string[128];
    new panels, doors, lights, tires;
    new vid;
		vid = GetPlayerVehicleID(playerid);
    GetVehicleDamageStatus(vid, panels, doors, lights, tires);
    format(string,sizeof(string),"vehicle damage is panels: %d, doors: %d, lights: %d, tires: %d",panels, doors, lights, tires);
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    return 1;
  }
  if (!strcmp("/spike", cmdtext))
  {
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid,x,y,z);
	  CreatePickup(1593,14,x,y,z,0);
    SendClientMessage(playerid, 0xFFFFFFFF, "spike");
    return 1;
  }
	return 0;
}

encode_tires(tire1, tire2, tire3, tire4) {

	return tire1 | (tire2 << 1) | (tire3 << 2) | (tire4 << 3);
}

encode_tires_bike(rear, front) {

	return rear | (front << 1);
}

public OnPlayerPickUpPickup(playerid,pickupid)
{
  UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), 0, 0, 0, encode_tires(1, 1, 1, 1));
  SendClientMessage(playerid, 0xFFFFFFFF, "you have driven over a spike strip!");
}



Re: R5 Spike Strip - Goobiiify - 25.03.2010

Quote:
Originally Posted by [ĦŁ₣
http://forum.sa-mp.com/index.php?topic=161912.0


Re: R5 Spike Strip - Rand_Omar - 26.03.2010

naah, none of the Spike Stripes that are working for me.. i need a working one.


Re: R5 Spike Strip - Flake. - 26.03.2010

Quote:
Originally Posted by ʂylaɾ
naah, none of the Spike Stripes that are working for me.. i need a working one.
why dont u try edit it to make it work! and stop askin for everything to be done


Re: R5 Spike Strip - br0adyb0ii - 27.03.2010

Quote:
Originally Posted by cessil
here's what I came up with in a couple of minutes, don't ask me to improve it because I won't you can edit it yourself

Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("spike strip filter script by cessil");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
  if (!strcmp("/repair", cmdtext))
  {
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
    RepairVehicle(GetPlayerVehicleID(playerid));
    SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
    return 1;
  }
  if (!strcmp("/pop", cmdtext))
  {
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
    UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), 0, 0, 0, encode_tires(1, 1, 1, 1));
    SendClientMessage(playerid, 0xFFFFFFFF, "popped tires?");
    return 1;
  }
  if (!strcmp("/dmg", cmdtext))
  {
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
    new string[128];
    new panels, doors, lights, tires;
    new vid;
		vid = GetPlayerVehicleID(playerid);
    GetVehicleDamageStatus(vid, panels, doors, lights, tires);
    format(string,sizeof(string),"vehicle damage is panels: %d, doors: %d, lights: %d, tires: %d",panels, doors, lights, tires);
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    return 1;
  }
  if (!strcmp("/spike", cmdtext))
  {
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid,x,y,z);
	  CreatePickup(1593,14,x,y,z,0);
    SendClientMessage(playerid, 0xFFFFFFFF, "spike");
    return 1;
  }
	return 0;
}

encode_tires(tire1, tire2, tire3, tire4) {

	return tire1 | (tire2 << 1) | (tire3 << 2) | (tire4 << 3);
}

encode_tires_bike(rear, front) {

	return rear | (front << 1);
}

public OnPlayerPickUpPickup(playerid,pickupid)
{
  UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), 0, 0, 0, encode_tires(1, 1, 1, 1));
  SendClientMessage(playerid, 0xFFFFFFFF, "you have driven over a spike strip!");
}
with this FS it's a mini roadblock spinning around