SA-MP Forums Archive
[FilterScript] RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! (/showthread.php?tid=189380)

Pages: 1 2


RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - Hiddos - 11.11.2010

Okay, I was a li'l bored lately and as Call of Duty: Black Ops has been released recently I thought of taking advantage of that, so I could make a new filterscript. I think y'all know the RC vehicle in Black Ops: You can control it, drive it under a specific player and detonate it. I made something like that for SA-MP.
Note that the "Usage Notice" is very, very, very important. I do not recommend real beginning scripters to do this.

Video
[ame]http://www.youtube.com/watch?v=x6dArcB_Rss[/ame]

Usage
For installing this to your server, look below. For using this when you're ACTUALLY IN THE RC VEHICLE, read further. If you're in an RC vehicle you need to press the 'fire' key (By default LMB) to make the vehicle explode. Press the fire key again to get back to your old position/camera. You automatically return to your old position/camera after 3.25 seconds after the vehicle explodes.

Usage notice
Note: If you use the include, skip this part.
This script is different then most scripts at usage. There isn't something that makes this script call functions. To use this script you need to use the "CallRemoteFunction" to this callback: PutPlayerInStreakVehicle(playerid).

An example of small usage:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  new Kills = GetPVarInt(killerid, "Kills")
  if(Kills == 5)
  {
    CallRemoteFunction("PutPlayerInStreakRcVehicle", "i", playerid);
  }
  return 1;
}
This code would put the player in one of those "Boom Boom' vehicles. However, you could also use this macro if you don't want to type that enormous sentence:
pawn Код:
#define PutPlayerInStreakRcVehicle(%0) CallRemoteFunction("PutPlayerInStreakRcVehicle", "i", (%0))
You'll need to place that code at the top of your script. Then you can simply type "PutPlayerInStreakRcVehicle(playerid)" and the code will get send.

I hope that you can get far enough with that code. For those who'd like something extra, you can use these two callbacks in your script: OnPlayerExitStreakRcVehicle(playerid) & OnPlayerEnterStreakRcVehicle(playerid, vehicleid). Add them to your script this way:
pawn Код:
//Gets called directly when the function gets called, but returns the vehicle ID. Pretty useless though
forward OnPlayerEnterStreakRcVehicle(playerid, vehicleid);
public OnPlayerEnterStreakRcVehicle(playerid, vehicleid)
{
  //more coding here
}

//Gets called when the player gets back to his 'old' state.
forward OnPlayerExitStreakRcVehicle(playerid);
public OnPlayerExitStreakRcVehicle(playerid)
{
  //Future coding here
}

//Gets called when the player actually detonates the vehicle ID.
forward OnPlayerExitStreakRcVehicle(playerid);
public OnPlayerDetonateStreakRcVehicle(playerid)
{
  //Future coding here
}
If you're wondering what you could do with these callbacks, here's an example idea (I won't provide coding): You could add an 3D text label above the player's head to tell other players that that player is driving an RC vehicle. Why you would do this? It could tell teammates to guard that player or tell enemies that shooting is useless (See notices). You could then use the 'exit' callback to delete this TextDraw again.

Downloads
Filterscript (Original release):
Pastebin.com
SolidFiles

Include (Recommended):
Pastebin.com
SolidFiles

Changelog
13/11/10 - Include released. I recommend people to use it instead of the FS.
11/11/10 - First release

Notices
* I didn't did major testing on bugs, please report any you may encounter
* When the player enters an RC vehicle, a 'model' of the player remains at his current position. This model, however, isn't solid and can't take damage. That means, if you'd shoot at it, you'd shoot right through it. Exploding the player won't work either.
* CallRemoteFunction is a function that allows a script to call a function in a different script, for more information: https://sampwiki.blast.hk/wiki/CallRemoteFunction
* I only barely tested the support for OnVehicleDeath (For example, some junk shoots a rocket launcher at yo' car and it goes BOOM
* I don't know for how long the video will still be processing . If it ain't up in 2 hours, I'll re-up it.
* Sometimes the camera goes under the surface of the earth. This usually happens if you're surround by higher points next to your vehicle. It looks weird, but it should still provide a good enough camera.


Credits
Special credits to:


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - dark_clown - 11.11.2010

nice fs


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - Whizion - 11.11.2010

Good job.


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - Hiddos - 11.11.2010

Thanks. I just noticed I uploaded the wrong file to SolidFiles rofl.

fixed


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - Dime - 11.11.2010

Good job Hiddos


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - vyper - 11.11.2010

nice one good job


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - ColdXX - 11.11.2010

Useless but at least original :P


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - Bessensap - 11.11.2010

Plain Fun ;p


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - Hiddos - 11.11.2010

Thanks. I might do an include version as well, just for ease of installing and usage hehe.


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - Steven82 - 11.11.2010

This is just epic


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - DartakousLien - 11.11.2010

Good
I'm use this =)


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - Flyfishes - 11.11.2010

Awesome!


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - Hiddos - 12.11.2010

Thanks. If I can't get MySQL to work today, I'll make an include version as well, which is way easier to use.


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - Aleluja - 12.11.2010

hahhahahaha so Cool


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - Hiddos - 13.11.2010

Updated the main post, I also created an include version I recommend people to download instead of the filterscript. The include gets called directly by "PutPlayerInStreakRcVehicle", not by CallRemoteFunction. And I also fixed a very minor bug which I don't feel like fixing in the FS.


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - Matej_ - 13.11.2010

Well done Hiddos, nice filterscript.


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - Kitten - 25.11.2010

Very nice i might use this thanks , hidde


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - [DOG]irinel1996 - 23.09.2011

I think you should close these callbacks.
Something like that:
pawn Код:
forward OnPlayerEnterStreakRcVehicle(playerid, vehicleid);
public OnPlayerEnterStreakRcVehicle(playerid, vehicleid)
{
  //more coding here
    return 1;
}

//Gets called when the player gets back to his 'old' state.
forward OnPlayerExitStreakRcVehicle(playerid);
public OnPlayerExitStreakRcVehicle(playerid)
{
  //Future coding here
    return 1;
}

//Gets called when the player actually detonates the vehicle ID.
forward OnPlayerExitStreakRcVehicle(playerid);
public OnPlayerDetonateStreakRcVehicle(playerid)
{
  //Future coding here
    return 1;
}
In rest, awesome.
Good job.


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - [MWR]Blood - 23.09.2011

Quote:
Originally Posted by irinel1996
Посмотреть сообщение
I think you should close these callbacks.
Something like that:
pawn Код:
forward OnPlayerEnterStreakRcVehicle(playerid, vehicleid);
public OnPlayerEnterStreakRcVehicle(playerid, vehicleid)
{
  //more coding here
    return 1;
}

//Gets called when the player gets back to his 'old' state.
forward OnPlayerExitStreakRcVehicle(playerid);
public OnPlayerExitStreakRcVehicle(playerid)
{
  //Future coding here
    return 1;
}

//Gets called when the player actually detonates the vehicle ID.
forward OnPlayerExitStreakRcVehicle(playerid);
public OnPlayerDetonateStreakRcVehicle(playerid)
{
  //Future coding here
    return 1;
}
In rest, awesome.
Good job.
I think you should look at the last post's date before bumping an almost 1 year old topic


Re: RC Boom Boom - CoD7 explodable RC vehicles for SA-MP! - Hiddos - 24.09.2011

Quote:
Originally Posted by irinel1996
Посмотреть сообщение
I think you should close these callbacks.
I don't really see a reason to do that, they're only called but not used to assign a value to anything.