W_Gates
Name: W_Gates
Description: This include file can allow you to add police department gates at and of the three major cities.
Credits: WeeDarr
Downloads:
Raw code: http://weedarr.pastebin.com/f75a23f74
.inc: http://solidfiles.com/d/6384
Documentation:
Natives
native AddLSPDGate();
native OpenLSPDGate(playerid,Float:Speed, bool: autoclose, time);
native CloseLSPDGate(playerid,Float:Speed);
native
native AddSFPDGate();
native OpenSFPDGate(playerid,Float:Speed, bool: autoclose, time);
native CloseSFPDGate(playerid,Float:Speed);
native
native AddLVPDGate();
native OpenLVPDGate(playerid,Float:Speed, bool: autoclose, time);
native CloseLvPDGate(playerid,Float:Speed);
Usage
Under #include <a_samp> put this, #include <w_Gates>
Under OnGameModeInit put any of the Add**PDGate, i will use the LS gate here
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddLSPDGate(); // thats all it is to add the gates.
return 1;
}
Now on to opening and closing, using a command we can simply do this
if (strcmp("/open", cmdtext, true, 10) == 0)
{
OpenLSPDGate(playerid, 3.0, 1, 30000); // playerid, speed, it autocloses in 30 secs
return 1;
}
if(strcmp("/close", cmdtext, true, 10) == 0)
{
CloseLSPDGate(playerid, 3.0); // playerid and 3.0 being the speed
return 1;
}
That goes inside the OnPlayerCommandText callback.
Examples
Where? | Link |
All Cities | http://weedarr.pastebin.com/f1f54d452 |
LS | http://weedarr.pastebin.com/f6993079d |
SF | http://weedarr.pastebin.com/f1941b503 |
LV | http://weedarr.pastebin.com/f4138a38b |