Not work!
#1

Hi I've creating a command for admins. but when I type /giveallweapon then type the Weapon ID + Ammo They are sending only the message but they did not give the players a weapon why?

PHP код:
CMD:giveallweapon(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= && 5)
    {
        new 
string[256],weaponid,ammo;
        new 
weaponName[32];
        if(
sscanf(params"uii"weaponidammo)) return SendClientMessage(playeridCOLOR_YELLOW"USAGE: /giveallweapon [Weapon ID] [Amount of Ammo]");
        {
            if(
PlayerInfo[playerid][pAdmin] <= && 2) return SendClientMessage(playerid, -1"{FF0000}Error: {FFFFFF}This command for admins +level 2.");
            
GetWeaponName(weaponidweaponNamesizeof weaponName);
            
GivePlayerWeapon(playeridweaponidammo);
            
format(string,sizeof(string),"{A82FED}[Weapon Given]: {FFFFFF}An Admin {A82FED}%s(%d) {FFFFFF}has given All players a {A82FED}%s {FFFFFF}with {A82FED}%d {FFFFFF}rounds of Ammo."PlayerName(playerid), playeridweaponNameammo);
            
SendClientMessageToAll(COLOR_ORANGE,string);
            
format(stringsizeof(string), "An Admin %s(%d) has Giving All players a %s with %d rounds of Ammo. (/giveallweapon)!"PlayerName(playerid), playeridweaponName,ammo);
            
SendToAdmins(COLOR_GREY,string);
        }
    }
    else
        
SendClientMessage(playerid, -1"{FF0000}Error: {FFFFFF}Wrong command!! {FF0000}Check availables commands from here `{FFFFFF}/cmds{FF0000}`.");
    return 
1;

Reply
#2

You're giving the weapon to the person who executes the commands.

PHP код:
for(new targetIndex 0maxIndex GetPlayerPoolSize(); targetIndex <= maxIndextargetIndex++)
    if(
IsPlayerConnected(targetIndex))
        
GivePlayerWeapon(targetIndexweaponidammo); 
Reply
#3

I'm sorry? What do you mean exatcly? I don't want to check the player If connected or not! because I've giving this weapons to All players In server.. Can you just helping me with ~ If an admin typing /Giveallweapon 24 24 They should give him Desert Eagle with 24 ammo! help
Reply
#4

Quote:
Originally Posted by Thanks
Посмотреть сообщение
I'm sorry? What do you mean exatcly? I don't want to check the player If connected or not! because I've giving this weapons to All players In server.. Can you just helping me with ~ If an admin typing /Giveallweapon 24 24 They should give him Desert Eagle with 24 ammo! help
how do i even respond to this... let's see....




its a loop.










good enough?
Reply
#5

are you joking with me or what?
Reply
#6

Quote:
Originally Posted by Thanks
Посмотреть сообщение
are you joking with me or what?
how do you seriously not know what a loop is but yet you script? go0gle it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)