SA-MP Forums Archive
Laser just for S.W.A.T - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Laser just for S.W.A.T (/showthread.php?tid=359709)



Laser just for S.W.A.T - fury14 - 15.07.2012

Hi, all can somebody give me a tutorial to make laser just for SWAT organisation... I know that there are filtescripts for laser, but how to make a laser just for SWAT can use it? Please help me


Re: Laser just for S.W.A.T - Captain_Mani - 15.07.2012

You should make teams for this. Then add it only for that team.


Re: Laser just for S.W.A.T - [MM]RoXoR[FS] - 15.07.2012

FS for laser : Laser Filterscript

To add it for team swat only

pawn Код:
//First define TEAMS
#define TEAM_SWAT 0
#define TEAM_OTHER 1

new gTeam[MAX_PLAYERS];

//Now you may assign team by
public OnPlayerRequestClass(playerid, classid)
{
    if(classid==0) gTeam[playerid] = TEAM_SWAT;
    //and so on
    return 1;
}
/*

++++++++NOW UNDER ON PLAYER UPDATE++++++++++
*/

public OnPlayerUpdate(playerid)
{
    if(gTeam[playerid]!=TEAM_SWAT) return 1;
    //And all the laser code here
    return 1;
}
If you will laser FS as a FS ,then ,in your GM add
pawn Код:
forward GetTeam(playerid);
public GetTeam(playerid)
{
    return gTeam[playerid];
}

//and in Laser filterscript add
public OnPlayerUpdate(playerid)
{
    new team = CallRemoteFunction("GetTeam","i",playerid);
    if(team!=0) return 1; //We defined TEAM_SWAT as 0 .
    //And all the laser code here
    return 1;
}