Detain command not working [DINI]
#1

Everything works down to "Player is not cuffed", but then it only sends the RP and doesn't put the player in the vehicle?

Код:
CMD:detain(playerid, params[])
{
	new playerb, seatid, string[128];
        if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
 	if(!IsACop(playerid) && !IsARES(playerid) && !IsFBI(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a LEO.");
	if(sscanf(params, "ui", playerb, seatid)) return SendClientMessage(playerid, COLOR_GREY, "SYNTAX: /detain [playerid] [seatid]");
	if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player specified.");
	if(!IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You can't detain someone from this distance.");
	if(!IsPlayerCuffed(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Player is not cuffed.");
	if(seatid < 2 || seatid > 3) return SendClientMessage(playerid, COLOR_GREY, "You can only detain people in seats 2 and 3.");
        PutPlayerInVehicle(playerid, LastCar[playerid], seatid);
	format(string, sizeof(string), "* %s grabs %s by their cuffs and places him inside the vehicle.", RPN(playerid), RPN(playerb));
	SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
	return 1;
}
Reply
#2

**Bump**

If you don't know the problem can you tell me how to make a detain command using a similar method to the one above?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)