Restriction cmd
#1

I can not do it to use the command only when the player has his hands raised (use /handsup).
What I did wrong?
When player use comand say to me: "acel player trebuie sa ridice mainile" (he must use handsup)
Код:
YCMD:confiscate(playerid, params[], help) {
    if(!IsACop(playerid)) return SCM(playerid,  COLOR_GREY, "Nu faci parte din factiunea politiei.");
	if(OnDuty[playerid] == 0) return SCM(playerid, COLOR_LGREEN, "Nu poti folosi aceasta comanda deoarece nu esti la datorie!");
	new item[15],id,string[180],query[180];
	if(sscanf(params, "us[15]",id,item)) {
		SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/confiscate <playerid/name> <item>");
		SCM(playerid, COLOR_WHITE, "Items: Driving, Weapons, Drugs.");
		return 1;
	}
	if(id != SPECIAL_ACTION_HANDSUP) return SCM(playerid, COLOR_GREY, "Acel player trebuie sa ridice mainile mai intai.");
	if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY, "Acel player nu este conectat.");
Reply
#2

And cmd: handsup
Код:
YCMD:handsup(playerid, params[], help) {
	if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_GREY, "Nu poti folosi animatii in timp ce esti intr-un vehicul.");
	if(Freezed[playerid] == 1) return 1;
	SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
	return 1;
}
Reply
#3

Код:
YCMD:confiscate(playerid, params[], help) {
    if(!IsACop(playerid)) return SCM(playerid,  COLOR_GREY, "Nu faci parte din factiunea politiei.");
	if(OnDuty[playerid] == 0) return SCM(playerid, COLOR_LGREEN, "Nu poti folosi aceasta comanda deoarece nu esti la datorie!");
	new item[15],id,string[180],query[180];
	if(sscanf(params, "us[15]",id,item)) {
		SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/confiscate <playerid/name> <item>");
		SCM(playerid, COLOR_WHITE, "Items: Driving, Weapons, Drugs.");
		return 1;
	}
	if(GetPlayerSpecialAction(id) != SPECIAL_ACTION_HANDSUP) return SCM(playerid, COLOR_GREY, "Acel player trebuie sa ridice mainile mai intai.");
	if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY, "Acel player nu este conectat.");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)