[Ajuda] Comando sem erros, mas nгo funciona bem.
#5

pawn Код:
CMD:dararma(playerid, params[])
{
    new playa;
    new gun;
    new ammo;
    new sendername[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
    new string[256];
    if(gun > 1||gun < 47) return SendClientMessage(playerid,-1,"((minimo - 1 | Maximo - 47))");
    if(ammo <1||ammo > 999) return SendClientMessage(playerid, COLOR_WHITE, "Tens de escolher entre , 1-999 balas.");
    if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
    if(sscanf(params, "udd",playerid, gun, ammo))
        {
                SendClientMessage(playerid, COLOR_WHITE, "Comando: /dararma [ID] [Arma] [Balas]");
                SendClientMessage(playerid, COLOR_WHITE, "________________________[ Lista de Armas ]________________________");
                SendClientMessage(playerid, COLOR_WHITE, "Comando: /dararma [playerid/PartOfName] [weaponid] [balas]");
                SendClientMessage(playerid, COLOR_WHITE, "3(Club) | 4(knife) | 5(bat) | 6(Shovel) | 7(Cue) | 8(Katana) | 10-13(Dildo) | 14(Flowers)");
                SendClientMessage(playerid, COLOR_WHITE, "16(Grenades) | 18(Molotovs) | 22(Pistol) | 23(SPistol) 24(Eagle) | 25(Shotgun) | 27(SPAS12)");
                SendClientMessage(playerid, COLOR_WHITE, "29(MP5) | 30(AK47) | 31(M4) | 33(Rifle) | 34(Sniper) | 35(Bazooka) | 37(Flamethrower)");
                SendClientMessage(playerid, COLOR_WHITE, "41(Spray) | 42(Fire Extinguisher) | 43(Camera) | 46(Parachute)");
                SendClientMessage(playerid, COLOR_WHITE, "______________________________________________________________");
        return true;
        }
    GetPlayerName(playa, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, 256, "[%s]deu ao player %s a arma - %d com %d balas.", sendername, giveplayer, gun, ammo);
    SendClientMessage(playerid, COLOR_WHITE, string);
    GivePlayerWeapon(playa, gun, ammo);
    return 1;
}
Notas: Use "u" - para id do player, use "i" ou "d" - para numeros, neste caso armas e balas, vocк colocou a mensagem antes do sscanf, logico que irб aparecer essa mensagem primeiro.

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)