SA-MP Forums Archive
[FilterScript] Police Faction/System ! [v1.0] -> Base Included - 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] Police Faction/System ! [v1.0] -> Base Included (/showthread.php?tid=545940)



Police Faction/System ! [v1.0] -> Base Included - HY - 11.11.2014

Introduction:


- Hello, I created a Police System, or Faction.

Members commands:


pawn Code:
/Open -> Will open the gate !
/Barrier -> Will open the barrier !
/Cuff -> Will cuff a player ! [Needs to be in Range of point 4 metres.]
/Uncuff -> Will uncuff a player ! [Needs to be in Range of point 4 metres.]
/R -> Speak in Radio Chat. A player doesn\'t see the text if you are in Range of more 50 metres !
/Arrest -> Arrests a player, but police man needs to be in down pick-up !
/Wanted -> Setting wanted to a player !
Leaders commands:


pawn Code:
* Leaders have acces to Members command !

/MakeLeader || Syntax: /MakeLeader [ID] -> Will make Leader a player !
/Invite || Syntax: /Invite [ID] -> Will invite a player !
/FKick || Syntax: /FKick [ID] -> Will kicks a player from Faction !
RCON commands:


pawn Code:
/PoliceLeader || Syntax: /PoliceLeader [ID] -> Will make a player leader in Police Faction !
Preview:













Download:


- Pastebin ;

- Solidfiles [ALL PACK + includes ]

- Free Upload Site [ALL PACK + includes]

- Filedropper [ALL PACK + includes]

- Megafile [ALL PACK + includes]


Re: Police Faction/System ! [v1.0] -> Base Included - Glossy42O - 11.11.2014

I really like it.


You make good things, Keep it up.


Repped.


Re: Police Faction/System ! [v1.0] -> Base Included - HY - 11.11.2014

Quote:
Originally Posted by Stuun
View Post
I really like it.


You make good things, Keep it up.


Repped.
Thanks.


Re: Police Faction/System ! [v1.0] -> Base Included - Abagail - 11.11.2014

This uses very insufficent code. Especially setting a player\'s color based on Wanted Level in OnPlayerUpdate.
And a few things plain out don\'t make sense:
Why give anti-kill to just cops? That has no logic, and gives cops unfair advantages. Also there is NO arrest system in place at all. When they get arrested, they have to (in RP servers, for the most part) either log off, or get an admin to let them out or some sort.


Re: Police Faction/System ! [v1.0] -> Base Included - ProKillerpa - 11.11.2014

Cool!


Re: Police Faction/System ! [v1.0] -> Base Included - HY - 12.11.2014

Quote:
Originally Posted by Abagail
View Post
This uses very insufficent code. Especially setting a player\'s color based on Wanted Level in OnPlayerUpdate.

And a few things plain out don\'t make sense:

Why give anti-kill to just cops? That has no logic, and gives cops unfair advantages. Also there is NO arrest system in place at all. When they get arrested, they have to (in RP servers, for the most part) either log off, or get an admin to let them out or some sort.
Have GodMode 15 seconds at Spawn, at base..

Quote:
Originally Posted by ProKillerpa
View Post
Cool!
Thanks !


Re: Police Faction/System ! [v1.0] -> Base Included - Alex Magaсa - 12.11.2014

nice work ! keep it up!


Re: Police Faction/System ! [v1.0] -> Base Included - Abagail - 13.11.2014

Another inefficent method. You\'re going to waste 30 lines when you could only use 1? It looks awful like this in my opionon.


What I\'m taking about:
pawn Code:
new V1;
pawn Code:
new V2;


This could easily be done in one line using...
pawn Code:
#define MAX_VEHICLE 30
pawn Code:
new Vehicles[MAX_VEHICLE];


Uncuff can also easily be abused by Law Officers. You don\'t even check if they are cuffed or not. Example using your existing code checking if they are even cuffed:

pawn Code:
CMD:uncuff(playerid, params[])
{
    if(PlayerInfo[playerid][Member] >= 1 || PlayerInfo[playerid][Leader] >= 1)
        {
                new Float:X;
                new Float:Y;
                new Float:Z;
                GetPlayerPos(playerid, X, Y, Z);
        if(IsPlayerInRangeOfPoint(playerid, 4.0, X, Y, Z))
        {
                        new ID;
                        new string[128];
                        new name[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, name, 24);
            if(sscanf(params,"i", ID)) return SendClientMessage(playerid,-1,"{FF0000}USAGE: {15FF00}/UnCuff [PlayerID]");
            if(GetPlayerSpecialAction(ID) == 24)
            {
                SetPlayerSpecialAction(ID, SPECIAL_ACTION_NONE);
                format(string, sizeof(string), "{0066CC}[POLICE]: {15FF00}You uncuffed {FF0000}%s {15FF00}!", ID);
                SendClientMessage(playerid, -1, string);
                format(string, sizeof(string), "{0066CC}{15FF00}You got uncuffed by Police Officer{FF0000}%s {15FF00}!", name);
                SendClientMessage(playerid, -1, string);
            }
        }
        }
        else
        {
                SCM(playerid, -1, "{FF0000}ERROR: {15FF00}You aren\'t Police !");
        }
        return 1;
}


Your indentation also makes me want to throw up. Just saying


EDIT: Also you have a few typos such as "metres" instead of "meters".


Re: Police Faction/System ! [v1.0] -> Base Included - AllyForgien - 03.01.2019


Very Nice script. It is very good and easy to use, as well as with a lot of typos and things I didn\'t like. I\'ve edited it to my needs though and it is doing me just fine. Thank you for this great script.


Re: Police Faction/System ! [v1.0] -> Base Included - AzaMx - 06.01.2019

Quote:
Originally Posted by AllyForgien
View Post
Very Nice script. It is very good and easy to use, as well as with a lot of typos and things I didn\'t like. I\'ve edited it to my needs though and it is doing me just fine. Thank you for this great script.
last: 13/11/2014, 09:18 AM

g00d bump.


Re: Police Faction/System ! [v1.0] -> Base Included - Kaliber - 07.01.2019

There are a lot of repetition in your code, thats very bad coding.


You wanna avoid that.


Try to use seperate functions, instead of calling it directly every time.


Also dont use
PHP Code:
OnPlayerUpdate 
for that stuff.


Because you know exatly the time when he get wanteds, so you can change the color there.


No need to check every ms 1000 times.


And the check in
PHP Code:
OnPlayerEnterVehicle 
is complete wrong.


That will not work.


It means you can enter every car and it will say you are in a police car.


Re: Police Faction/System ! [v1.0] -> Base Included - N0FeaR - 07.01.2019

Nice work keep it up!


Re: Police Faction/System ! [v1.0] -> Base Included - Usmanmemon - 12.01.2019

GOOD WORK


Re: Police Faction/System ! [v1.0] -> Base Included - CaptainBoi - 13.01.2019

good efforts


Re: Police Faction/System ! [v1.0] -> Base Included - Wherethescripters - 13.01.2019

Very nice work, That\'s cool