25.03.2010, 02:45
Has anybody made a script with the spike strip that is compatible with the new R5 spike strip tire popping features.
forward OnVehicleDamageStatusUpdate(vehicleid, playerid);
native GetVehicleDamageStatus(vehicleid, &panels, &doors, &lights, &tires);
native UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
// 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!"); }
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
http://forum.sa-mp.com/index.php?board=62.0 |
Originally Posted by ʂylaɾ
naah, none of the Spike Stripes that are working for me.. i need a working one.
|
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!"); } |