SA-MP Forums Archive
[Ajuda] Comando /dararma - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Comando /dararma (/showthread.php?tid=335158)



[Ajuda] Comando /dararma - KilleRJunioR - 17.04.2012

Bem galera tenho o cmd /dararma mais esse cmd nгo consegui deixar do jeito ideal que vou explicar tipo esse dararma tem como da qualquer arma para qualquer players inclusive as proibidas eu queria que sу quem pudesse usar tais armas proibidas fossem adms em modo de trabalho e em modo de jogo mais players nao e queria que aparecesse que tal adm deu tal arma para tal pessoa sera que da pra dar uma ajudinha? Obg desde ja.

Armas Para Proibir:
pawn Код:
if(gun < 1 || gun > 46 || gun==38 || gun==35 || gun==36 || gun==37 || gun==44 || gun==45 || gun==9 || gun==17 || gun==16 || gun==18 || gun==22 || gun==26 || gun==27 || gun==28 || gun==32 || gun==39 || gun==40)

pawn Код:
if(strcmp(cmd, "/dararma", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /dararma [ id ] [weaponid(eg. 46 = Parachute)] [ammo]");
                return 1;
            }
            new playa;
            new gun;
            new ammo;
            playa = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            gun = strval(tmp);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USE: /dararma [ id ] [weaponid] [ammo]");
                SendClientMessage(playerid, COLOR_GRAD4, "3(Club) 4(knife) 5(bat) 6(Shovel) 7(Cue) 8(Katana) 10-13(Dildo) 14(Flowers) 16(Grenades) 18(Molotovs) 22(Pistol) 23(SPistol)");
                SendClientMessage(playerid, COLOR_GRAD3, "24(Eagle) 25(shotgun) 29(MP5) 30(AK47) 31(M4) 33(Rifle) 34(Sniper) 37(Flamethrower) 41(spray) 42(exting) 43(Camera) 46(Parachute)");
                return 1;
            }
            if(gun < 1 || gun > 46 || gun==38 || gun==35 || gun==36 || gun==37 || gun==44 || gun==45 || gun==9 || gun==17 || gun==16 || gun==18 || gun==22 || gun==26 || gun==27 || gun==28 || gun==32 || gun==39 || gun==40)
            { SendClientMessage(playerid, COLOR_GRAD1, "   ID Proibido!"); return 1; }
            tmp = strtok(cmdtext, idx);
            ammo = strval(tmp);
            if(ammo <1||ammo > 9999)
            { SendClientMessage(playerid, COLOR_GRAD1, "   O minimo de balas й 1 e o mбximo й 9999!"); return 1; }
            if (PlayerInfo[playerid][pAdmin] >= 4)
            {
                if(admtrampando[playerid] < 1)
                {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/jogar)");
                return 1;
                }
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        GivePlayerWeapon(playa, gun, ammo);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Voce nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
    }



Re: [Ajuda] Comando /dararma - Trigo - 17.04.2012

pawn Код:
if(strcmp(cmd, "/dararma", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /dararma [ id ] [weaponid(eg. 46 = Parachute)] [ammo]");
                return 1;
            }
            new playa;
            new gun;
            new ammo;
            playa = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            gun = strval(tmp);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USE: /dararma [ id ] [weaponid] [ammo]");
                SendClientMessage(playerid, COLOR_GRAD4, "3(Club) 4(knife) 5(bat) 6(Shovel) 7(Cue) 8(Katana) 10-13(Dildo) 14(Flowers) 16(Grenades) 18(Molotovs) 22(Pistol) 23(SPistol)");
                SendClientMessage(playerid, COLOR_GRAD3, "24(Eagle) 25(shotgun) 29(MP5) 30(AK47) 31(M4) 33(Rifle) 34(Sniper) 37(Flamethrower) 41(spray) 42(exting) 43(Camera) 46(Parachute)");
                return 1;
            }
            if(gun < 1 || gun > 46 || gun==38 || gun==35 || gun==36 || gun==37 || gun==44 || gun==45 || gun==9 || gun==17 || gun==16 || gun==18 || gun==22 || gun==26 || gun==27 || gun==28 || gun==32 || gun==39 || gun==40)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   ID Proibido!");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            ammo = strval(tmp);
            if(ammo <1||ammo > 9999)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   O minimo de balas й 1 e o mбximo й 9999!");
                return 1;
            }
            if (PlayerInfo[playerid][pAdmin] >= 4)
            {
                if(admtrampando[playerid] < 1)
                {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/jogar)");
                return 1;
                }
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        new PlayerAdm[256],PlayerArmado[256],str[256];
                        GetPlayerName(playa,PlayerArmado,sizeof(PlayerArmado));
                        GetPlayerName(playerid,PlayerAdm,sizeof(PlayerAdm));
                        format(str,sizeof(str),"O Admin %s deu a arma %d ao player %s .",PlayerAdm,gun,PlayerArmado);
                        SendClientMessage(playerid, COLOR_GRAD1,str);
                        GivePlayerWeapon(playa, gun, ammo);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Voce nгo esta autorizado a usar este comando!");
               
            }
        }
        return 1;
    }
Nгo testei... c der algum erro avisa aki... se nгo funfa avisa.... se nгo for oq pediu avisa tbm... kkkkkk


Re: [Ajuda] Comando /dararma - Don_Speed - 17.04.2012

pawn Код:
if(strcmp(cmd, "/dararma", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /dararma [ id ] [weaponid(eg. 46 = Parachute)] [ammo]");
                return 1;
            }
            new playa;
            new gun;
            new ammo;
            playa = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            gun = strval(tmp);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USE: /dararma [ id ] [weaponid] [ammo]");
                SendClientMessage(playerid, COLOR_GRAD4, "3(Club) 4(knife) 5(bat) 6(Shovel) 7(Cue) 8(Katana) 10-13(Dildo) 14(Flowers) 16(Grenades) 18(Molotovs) 22(Pistol) 23(SPistol)");
                SendClientMessage(playerid, COLOR_GRAD3, "24(Eagle) 25(shotgun) 29(MP5) 30(AK47) 31(M4) 33(Rifle) 34(Sniper) 37(Flamethrower) 41(spray) 42(exting) 43(Camera) 46(Parachute)");
                return 1;
            }
            if(gun < 1 || gun > 46 || gun==38 || gun==35 || gun==36 || gun==37 || gun==44 || gun==45 || gun==9 || gun==17 || gun==16 || gun==18 || gun==22 || gun==26 || gun==27 || gun==28 || gun==32 || gun==39 || gun==40)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   ID Proibido!");
                ResetPlayerWeapons(playerid);
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            ammo = strval(tmp);
            if(ammo <1||ammo > 9999)
            { SendClientMessage(playerid, COLOR_GRAD1, "   O minimo de balas й 1 e o mбximo й 9999!"); return 1; }
            if (PlayerInfo[playerid][pAdmin] >= 4)
            {
                if(admtrampando[playerid] < 1)
                {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/jogar)");
                return 1;
                }
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        GivePlayerWeapon(playa, gun, ammo);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Voce nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
    }