arrest
#1

can someone help me with arrest CMD becuse i could dont find one if it on ****** can u help
Reply
#2

Please help me !!
Reply
#3

Be more specific. What do you want in this command? When you typ the command, what parameters do you want? (eg. only entering the ID of the person you want to arrest, or also a reason). Who may use the /arrest command? Can it be used everywhere or just on one specific place? Do you want an animation in it? Etcetera.

p.s.
You're Dutch too?
Reply
#4

PHP код:
CMD:arrest(playerid,params[])
{    
if(
PlayerInfo[playerid][pMember] || PlayerInfo[playerid][pLeader]){
    new 
id,time,reason[100],PlayerName[MAX_PLAYER_NAME],GPlayerName[MAX_PLAYER_NAME];
    new 
string[128];
    if(!
IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Invalid ID!");
    if(
sscanf(params,"uds",id,time,reason)) return SendClientMessage(playerid,-1,"USAGE: /arrest <id> <time> <reason>");
        
GetPlayerName(id,PlayerName,sizeof(PlayerName));
        
GetPlayerName(playerid,GPlayerName,sizeof(GPlayerName));
        
format(string,sizeof(string)," %s has arrested %s for %d, reason: %s ",GPlayerName,PlayerName,time,reason);
        
SetPlayerInterior(id3);
        
SetPlayerVirtualWorld(id10);
        
SetPlayerFacingAngle(id360.0);
        
SetPlayerPos(id197.5662175.48001004.0);
        
SetPlayerHealth(id9999999999.0);
        
ResetPlayerWeapons(id);
        
JailTimer[id] = SetTimerEx("Unjail",time*60000false"i"id);
        }else{
        return 
0;
        }
    return 
1;

i just made this its not tested!
Reply
#5

xMCx:
1- What if he has his own gamemode, or another one then you are using? For example, the "PlayerInfo" variable may not exist, just like this "JailTimer". And what about the "Unjail" function? You didn't include that either. This won't just work.
2- You may not give untested code. And are you sure you didn't just copy this?
You also don't know if he's using the standard OnPlayerCommandText callback, ZCMD, DCMD or YCMD.
Reply
#6

Код:
CMD:arrest(playerid, params[])
{
	if(PlayerInfo[playerid][Fmember] == 1)
	{
		new toplayer;
		new jailtime;
		new price;
		if(!sscanf(params, "uii", toplayer, jailtime, price))
		{
			    if((jailtime >= 1 && jailtime <= 10))
			    {
					if(IsPlayerInRangeOfPoint(toplayer, 20.0, 221.9771, 121.3747, 999.0156))
					{
						if(IsPlayerInRangeOfPoint(playerid, 20.0, 221.9771, 121.3747, 999.0156))
						{
								new string[128];
								new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
								GetPlayerName(playerid, name, sizeof(name));
								GetPlayerName(toplayer, PlayerName, sizeof(PlayerName));
								format(string, sizeof(string), "You are jailed for %d days by %s!", jailtime * 60000, name);
								SCM(toplayer, COLOR_BLUE, string);
								SetPlayerPos(toplayer, 219.3402, 110.0057, 999.0156);
								SetPlayerInterior(toplayer, 10);
								ResetPlayerWeapons(toplayer);
								jailed[toplayer] = 1;
           	        	  	    SetTimerEx("unjail", jailtime * 60000, false, "i", toplayer);
           	        	  	    GivePlayerCash(toplayer, -price);
           	        	  	   	PlayerInfo[toplayer][Suspect] = sus_no;
								SetPlayerColor(toplayer, COLOR_WHITE);
						}
				 		else return SendClientMessage(playerid, 0x2641FEAA, "You are not near the jail!");
					}
					else return SendClientMessage(playerid, 0x2641FEAA, "No suspect near the jail!");
				}
				else return SendClientMessage(playerid, 0x2641FEAA, "Jailtime cant be shorter then 1 or longer then 10");
		}
		else return SendClientMessage(playerid, 0x2641FEAA, "USAGE: /arrest [Playername] [JailTime] [price]");
	}
	else return SendClientMessage(playerid, 0x2641FEAA, "You are not a cop!");
	return 1;
}
Not mine, although you haven't specified much, the command above is most common one, for cops.
Reply
#7

RanSEE, did you even read the comments?
Reply
#8

Quote:
Originally Posted by Kwarde
Посмотреть сообщение
xMCx:
1- What if he has his own gamemode, or another one then you are using? For example, the "PlayerInfo" variable may not exist, just like this "JailTimer". And what about the "Unjail" function? You didn't include that either. This won't just work.
2- You may not give untested code. And are you sure you didn't just copy this?
You also don't know if he's using the standard OnPlayerCommandText callback, ZCMD, DCMD or YCMD.
ur right, but i didnt copy it, also i made this with the all common variables that people use, but if he tested it and gave us errors we can help him more and more, and about the unjail function and the jailtimer imma post it now
i forgot it ..
PHP код:
new JailTimer[MAX_PLAYERS];//add this in the top of ur script under includes 
Reply
#9

Quote:
Originally Posted by Kwarde
Посмотреть сообщение
RanSEE, did you even read the comments?
i posted a few seconds after yours, was typing when you posted i guess.
Reply
#10

Ah... In that case, sorry for that comment of mine :P. Happens to me too sometimes. But when it happens to others I just don't think about that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)