R5 Spike Strip
#1

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


Reply
#2

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

Atleast attempt it.
Reply
#3

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);
Reply
#4

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

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!");
}
Reply
#6

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

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

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
Reply
#9

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)