Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- #define FILTERSCRIPT
- new Float:x, Float:y, Float:z;
- new Float:rz;
- new spike;
- new Spikes;
- #include <a_samp>
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- return 1;
- }
- public OnFilterScriptExit()
- {
- DestroyObject(spike);
- return 1;
- }
- #endif
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (!strcmp("/spike", cmdtext))
- {
- if(Spikes == 0)
- {
- GetPlayerPos(playerid,x,y,z);
- GetPlayerFacingAngle(playerid, rz);
- spike = CreateObject(2892, x, y, z-0.8, 0, 0, rz+90);
- SendClientMessage(playerid, 0xFFFFFFFF, "Spike Strip Set!");
- Spikes = 1;
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "There Is Already A Spike Strip Set!");
- }
- return 1;
- }
- return 0;
- }
- encode_tires(tire1, tire2, tire3, tire4) {
- return tire1 | (tire2 << 1) | (tire3 << 2) | (tire4 << 3);
- }
- public OnPlayerUpdate(playerid)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z))
- {
- UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), 0, 0, 0, encode_tires(1, 1, 1, 1));
- DestroyObject(spike);
- Spikes = 0;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement