08.12.2015, 00:30
My sub command is not working:
Its only executing up to lines:
This line is not beeing executed:
The Usage of the command:
Код:
if(strcmp("/retirar", cmdtext, true) == 0)
{
if(IsPlayerConnected(playerid))
{
new x_Emprego[256];
x_Emprego = strtok(cmdtext,idx);
if(!strlen(x_Emprego))
{
SendClientMessage(playerid,COLOR_AMARELO_FORTE,"|================ BLF - Retirar =================|");
return 1;
}
else if(strcmp(x_Emprego,"armas",true) == 0)
{
if(togDebug[playerid] == 1) { SendClientMessage(playerid, COLOR_DEBUG, "Debug: 123"); }
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"USE: /retirar armas [ID do Jogador]");
new targetID;
targetID = ReturnUser(tmp);
new Float:posx, Float:posy, Float:posz;
GetPlayerPos(targetID, posx,posy,posz);
new alvo[MAX_PLAYER_NAME];
GetPlayerName(targetID, alvo,sizeof(alvo));
if(togDebug[playerid] == 1) { SendClientMessage(playerid, COLOR_DEBUG, "Debug: 124"); }
if(!IsPlayerConnected(targetID)) return SendClientMessage(playerid, COLOR_AVISO, "Jogador nгo encontrado!");
if(togDebug[playerid] == 1) { SendClientMessage(playerid, COLOR_DEBUG, "Debug: 125"); }
if(targetID == playerid) return SendClientMessage(playerid, COLOR_AVISO, "Vocк nгo pode se retirar armas.");
if(!IsPlayerInRangeOfPoint(playerid, 1.5, posx,posy,posz)) return SendClientMessage(playerid, COLOR_WHITE,"Jogador muito longe para retirar as Armas dele.");
if(GetPlayerWeapon(playerid) <= 1)
{
if(GetPlayerSpecialAction(targetID) == SPECIAL_ACTION_HANDSUP || Algemado[targetID] == true)
{
if(GetPlayerWeapon(targetID) <= 1)
{
ResetPlayerWeapons(targetID);
}
else SendClientMessage(playerid, COLOR_AVISO,"Essa pessoa estб com alguma arma na mгo.");
}
else SendClientMessage(playerid, COLOR_AVISO,"Jogador nгo estб com as mгos pro alto.");
}
else SendClientMessage(playerid, COLOR_AVISO,"Vocк estб com alguma arma na mгo. Fique sem arma na mгo e tente novamente.");
}
else { SendClientMessage(playerid, COLOR_AVISO,"??????"); }
}
return SendClientMessage(playerid, COLOR_AVISO,"222");
}
Код:
SendClientMessage(playerid,COLOR_AMARELO_FORTE,"|================ BLF - Retirar =================|"); return 1;
Код:
else if(strcmp(x_Emprego,"armas",true) == 0)
Код:
/retirar armas [Target ID]


