[Help]How to make Police System
#1

Help
Reply
#2

Post more details for this system...
Reply
#3

You can't really come onto the forums, and ask someone to make an entire system for you..If you're having to do that, I'd politely suggest that you may need to learn some basics before hand (No offense intended).

Learn the basics of PAWN, and also MySQL, and how MySQL integrates with PAWN. Once you're fairly comfortable, design and plan your own police system, for how you wish it to work to your own bespoke needs. Then...try and script it. If you need help at that point, with certain things then by all means, help will be available.
Reply
#4

Код:
new PoliceMan[MAX_PLAYERS];

if(PoliceMan[playerid] == 1) return SendClientMessage(playerid, -1, "You're a cop!");
So on so forth.
Reply
#5

Commands:/buycop- to buy police badge
/arrest- to arrest player for time and reason
/wanted
Reply
#6

(*|Flake|*) got it best for comedic value.

Other than that you need the Looking for Scripters thread, or you're gonna need to start learning.


Team systems are simple, and tutorials are out there.
Reply
#7

POLICE system by DRAGON
https://sampforum.blast.hk/showthread.php?tid=436193
Reply
#8

Quote:
Originally Posted by vikoo
Посмотреть сообщение
This guy lifts.
Reply
#9

who is lifts?
Reply
#10

This is very simple, but... (I have not tested)
Код:
#include a_samp
#include sscanf2
#include zcmd


new bool:Arrested[MAX_PLAYERS], TimeArrested[MAX_PLAYERS];


main() {

	SetTimer("CheckArrested", 1000, true);
	
}

CMD:buycop(playerid)
{
	if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, -1, "You don't have money [$ 5.000].");
	
	GivePlayerMoney(playerid, - 5000);
	
	SendClientMessage(playerid, -1, "Now you is a Cop!");
	
	return 1;
}

CMD:arrest(playerid, params[])
{
	new Target, Time, Reason[30];
	
	if(sscanf(params, "uis[30]", Target, Time, Reason)) return SendClientMessage(playerid, -1, "/arrest [name/id] [time (minutes)] [reason]");
	
	if(!IsPlayerConnected(Target)) return SendClientMessage(playerid, -1, "PlayerID not connected.");
	
	if(Time < 0) return SendClientMessage(playerid, -1, "Invalid time.");
	
	TogglePlayerControllable(Target, 0);
	
	TimeArrested[Target] = Time * 60 + gettime();
	
	Arrested[Target] = true;
	
	return 1;
}

forward CheckArrested();
public CheckArrested()
{
	for(new i = 0; i < MAX_PLAYERS; ++ i)
	{
		if(!IsPlayerConnected(i)) continue;
		
		if(Arrested[i] == true)
		{
			if(TimeArrested[i] > gettime()) TimeArrested[i] --;
			else Arrested[i] = false, TimeArrested[i] = 0;
		}
	}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)