[Ajuda] Me ajudem criar comando para setar admin
#16

Se nгo tiver resolvido ainda tente dessa forma:
PHP Code:
#include            <a_samp>
#include            <sscanf2>
#include            <zcmd>
CMD:dararma(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)
        return 
SendClientMessage(playerid0xFF0000FF"|ERRO| » Vocк nгo й Admin RCON!");
    new 
player1ArmaNome[32], IdArmaQuantiaArmaNome2[32], string[128];
    if(
sscanf(params"us[32]D(500)"player1ArmaNomeQuantia))
        return 
SendClientMessage(playerid0xFF0000FF"|USE| » /dararma [playerid] [arma id/arma nome] [muniзгo]");
    if(
player1 == INVALID_PLAYER_ID)
        return 
SendClientMessage(playerid0xFF0000FF"|ERRO| » O jogador nгo estб conectado.");
    if(!
IsNumeric(ArmaNome)) IdArma GetWeaponIDFromName(ArmaNome); else IdArma strval(ArmaNome);
    
GetWeaponName(IdArmaArmaNome232);
    
format(stringsizeof(string), "Vocк deu a arma %s (%d) com %d de muniзгo para o jogador: \"%s\""ArmaNome2IdArmaQuantiapName(player1));
    
SendClientMessage(playerid0x00FF00FFstring);
    if(
player1 != playerid)
    {
        
format(string,sizeof(string),"O Admin \"%s\" te deu a arma %s (%d) com %d de muniзгo"pName(playerid), ArmaNome2IdArmaQuantia);
        
SendClientMessage(player10xFFFF00FFstring);
    }
    
GivePlayerWeapon(player1IdArmaQuantia);
    return 
1;
}
stock GetWeaponIDFromName(WeaponName[])
{
    if(
strfind("molotov",WeaponName,true)!=-1) return 18;
    for(new 
0<= 46i++)
    {
        switch(
i)
        {
            case 
0,19,20,21,44,45: continue;
            default:
            {
                new 
name[32]; GetWeaponName(i,name,32);
                if(
strfind(name,WeaponName,true) != -1) return i;
            }
        }
    }
    return -
1;
}
stock IsNumeric(string[])
{
    for (new 
0strlen(string); ji++)
    {
        if (
string[i] > '9' || string[i] < '0') return 0;
    }
    return 
1;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 6 Guest(s)