11.11.2010, 15:08
(
Последний раз редактировалось Hiddos; 13.11.2010 в 10:30.
)
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:
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:
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:
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:
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;
}
pawn Код:
#define PutPlayerInStreakRcVehicle(%0) CallRemoteFunction("PutPlayerInStreakRcVehicle", "i", (%0))
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
}
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

* 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:
- ****** - PAWN Pre-processor thread. Even though it's a very, very, very small role (The macro), credits are credits.
- Seif_ - Even though he isn't around, I got to know the floatsin/floatcos function usage.
- Bessensap - Testing