05.12.2016, 08:21
Tem como passar parametro ao forзar comando?
Tipo quando eu forзo comando, sу consigo pra playerid
Exemplo:
Eu queria fazer isso aqui:
Mas ta dando
Tipo quando eu forзo comando, sу consigo pra playerid
Exemplo:
Код:
cmd_kill(playerid);
Код:
CMD:kill(playerid) { SetPlayerHealth(playerid, 0); return 1; }
Код:
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; }
Код:
error 035: argument type mismatch (argument 2)