CMD:dararma(playerid, params[])
{
if (PlayerInfo[playerid][Admin] >= 4)
{
new arma;
new id;
new muni;
if (sscanf(params, "ud", id, arma, muni))
return SendClientMessage(playerid, 0xFF0000AA, "[ERRO] Use: /dararma [ID] [ARMA] [MUNI]");
GivePlayerWeapon(id, arma, muni);
new nick1[MAX_PLAYER_NAME];
new nick2[MAX_PLAYER_NAME];
new str[128];
GetPlayerName(playerid, nick1, MAX_PLAYER_NAME);
GetPlayerName(id, nick2, MAX_PLAYER_NAME);
format(str, sizeof str, "O Admin: %s deu uma arma para o jogador %s", nick1, nick2);
SendClientMessageToAll(0xFF80FFAA, str);
return 1;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "[ERRO] Vocк nгo tem permiзгo!");
return 1;
}
return 1;
}
|
Olб, eu estou com um problema em um comando que eu criei, o comando й o seguinte: й um comando que somente admins tem acesso e que da armas para jogadores, porem quando eu digito o comando, ate da a arma, porem ela some logo depois. Espero que me ajudem, segue abaixo o codigo.
PHP код:
|
if (sscanf(params, "udd", id, arma, muni)) return SendClientMessage(playerid, 0xFF0000AA, "[ERRO] Use: /dararma [ID] [ARMA] [MUNI]");
CMD:dararma(playerid, params[])
{
if (PlayerInfo[playerid][Admin] >= 4)
{
new arma;
new id;
new muni;
if (sscanf(params, "udd", id, arma, muni))
return SendClientMessage(playerid, 0xFF0000AA, "[ERRO] Use: /dararma [ID] [ARMA] [MUNI]");
GivePlayerWeapon(id, arma, muni);
new nick1[MAX_PLAYER_NAME];
new nick2[MAX_PLAYER_NAME];
new str[128];
GetPlayerName(playerid, nick1, MAX_PLAYER_NAME);
GetPlayerName(id, nick2, MAX_PLAYER_NAME);
format(str, sizeof str, "O Admin: %s deu uma arma para o jogador %s", nick1, nick2);
SendClientMessageToAll(0xFF80FFAA, str);
return 1;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "[ERRO] Vocк nгo tem permiзгo!");
return 1;
}
return 1;
}
|
CMD:dararma(playerid, params[]) { if(GetPlayerCargo(playerid) < C_ADMIN) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Vocк nгo tem permissгo!"); new id, armaid, municao; if(sscanf(params, "ddd", id, armaid, municao)) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Uso correto: /DarArma [ ID ] [ Arma ID ] [ Muniзгo ]"); if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Ninguйm online com esse ID!"); if(armaid < 1 || armaid > 46) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Arma invбlida!"); if(municao < 1) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Muniзгo invбlida!"); GivePlayerWeapon(id, armaid, municao); new aNome[50]; GetWeaponName(armaid, aNome, sizeof(aNome)); format(gStr, sizeof(gStr), "[BPL Staff] Vocк deu a arma %s para o(a) jogador(a) %s", aNome, pNome(id)); SendClientMessage(playerid, COLOR_VERDECMD, gStr); if(aInfo[playerid][Oculto] == false) { format(gStr, sizeof(gStr), "[BPL Staff] %s lhe deu a arma %s.", GetCargoMsg(playerid), aNome); SendClientMessage(id, COLOR_VERDECMD, gStr); } return 1; } |