spikes police (gTeam) only -
Edward d - 29.10.2012
help request . need help to make spike police (gteam) only the spikes in this fs looks and works good with my GM . heres the FS code. i need fixed
Код:
/ uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#define gTeam
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;
}
HERES How my Game Mode Uses the (gTeam) with all includes and defines it has . im not trying to add this fs to GM just fix the fs and pastebin it or something thx
Game mode stuff
#include <a_samp>
#include <dudb>
#include <CPLoader>
#define CIVILIAN 0
#define Medic 1
#define COP 2
#define FBI 3
#define SWAT 4
#define ARMY 5
SetPlayerTeamFromClass(playerid, classid)
{
if(classid >= 0 && classid <= 5) gTeam[playerid] = COP;
else if(classid == 6) gTeam[playerid] = FBI;
else if(classid == 7) gTeam[playerid] = SWAT;
else if(classid ==

gTeam[playerid] = ARMY;
else if(classid >= 9 && classid <= 11) gTeam[playerid] = Medic;
else if(classid >= 12 && classid <= 30) gTeam[playerid] = CIVILIAN;
}
Re: spikes police (gTeam) only -
Edward d - 30.10.2012
im sure someone can do this . come on guys pls, im so good at scripting and by the time i learn sa-mp will close . trust me .
Re: spikes police (gTeam) only -
[HK]Ryder[AN] - 30.10.2012
You will need to add this fs to your gamemode
OR
Use PVars becuz as far as i know they can work between different scripts.
Re: spikes police (gTeam) only -
Edward d - 31.10.2012
yea but im not a scriptor so i dont know what to add to the fs so it would be (gteam,police) only .
i dont want Criminals to have spikes.
Re: spikes police (gTeam) only -
ThePhenix - 31.10.2012
Just add the Script to your Gamemode script.
Re: spikes police (gTeam) only -
Edward d - 01.11.2012
what ? the script is spikes for eveyone i need to get script changed to (police only) lol if i just add it to my GM its not going to change the script lol
Re: spikes police (gTeam) only -
Stu1 - 01.11.2012
Add script to gamemode
Use if(gTeam[playerid] == FBI
Re: spikes police (gTeam) only -
Edward d - 02.11.2012
stll dont work
Re: spikes police (gTeam) only -
seoseokbin - 02.01.2013
awesome