[Ajuda] Tem como passar parametro ao forзar comando?
#3

Quote:
Originally Posted by ipsLuan
Посмотреть сообщение
cmd_kill(playerid,params);
Entгo o /kill eu botei de exemplo, pq sу funciona comando sem parametro
Quando eu tento fazer um com parametro como quero fazer com o /cuff da erro, como eu botei lб em cima

Код:
error 035: argument type mismatch (argument 2)
Код:
new targetplayer = GetPlayerTargetPlayer(playerid);
cmd_cuff(playerid, targetplayer);
Код:
CMD:cuff(playerid, params[]) {
	if(org[playerid] == 5) return SendClientMessage(playerid, COLOR_RED, "MEDICs can not use this command.");
	if(morto[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "You can not use this command killed.");
	if(!IsACop(playerid)) return SendClientMessage(playerid, -1, "You aren't a COP");
	new id;
	if(sscanf(params,"u", id)) return SendClientMessage(playerid, -1, "Use: /cuff [id]");
	if(id != INVALID_PLAYER_ID) {
		if(GetPlayerSpecialAction(id) != SPECIAL_ACTION_HANDSUP && morto[id] != true) return SendClientMessage(playerid, COLOR_GRAD2, "The player need be handsup,imo or dead!");
		if(PlayerCuffed[id] > 0) return	SendClientMessage(playerid, COLOR_GREY, "This player is already cuffed!");
		if (ProxDetectorS(8.0, playerid, id)) { Cuffing(playerid, id); }
	}
	return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)