/event problem.
#1

pawn Код:
if(strcmp(cmd, "/event", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        if(PlayerInfo[playerid][pAdmin] >= 4)
        {
                new x_nr[256];
                x_nr = strtok(cmdtext, idx);
            if(!strlen(x_nr))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /event [guns,health,teleport]");
            return 1;
        }
            if(strcmp(x_nr,"guns",true) == 0)
            {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                    SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /event guns [gunid][ammo]");
            return 1;
                }
                    new gun;
                new ftext[50];
                    if(gun == 1) { ftext = "Brass Knuckles"; }
                    else if(gun == 2) { ftext = "Golf Club"; }
                    else if(gun == 3) { ftext = "NightStick"; }
                    else if(gun == 4) { ftext = "Knife"; }
                    else if(gun == 5) { ftext = "Baseball Bat"; }
                    else if(gun == 6) { ftext = "Shovel"; }
                    else if(gun == 7) { ftext = "Pool Cue"; }
                    else if(gun == 8) { ftext = "Katana"; }
                    else if(gun == 9) { ftext = "Chainsaw"; }
                    else if(gun == 10) { ftext = "Purple Dildo"; }
                    else if(gun == 11) { ftext = "Small White Vibrator"; }
                    else if(gun == 12) { ftext = "Large White Vibrator"; }
                    else if(gun == 13) { ftext = "Silver Vibrator"; }
                    else if(gun == 14) { ftext = "Flowers"; }
                    else if(gun == 15) { ftext = "Cane"; }
                    else if(gun == 16) { ftext = "Grenade"; }
                    else if(gun == 17) { ftext = "Tear Gas"; }
                    else if(gun == 18) { ftext = "Molotov Cocktail"; }
                    else if(gun == 22) { ftext = "9MM"; }
                    else if(gun == 23) { ftext = "Silenced 9mm"; }
                    else if(gun == 24) { ftext = "Desert Eagle"; }
                    else if(gun == 25) { ftext = "Shotgun"; }
                    else if(gun == 26) { ftext = "Sawn-off Shotgun"; }
                    else if(gun == 27) { ftext = "Combat Shotgun"; }
                    else if(gun == 28) { ftext = "Micro SMG"; }
                    else if(gun == 29) { ftext = "MP5"; }
                    else if(gun == 30) { ftext = "AK-47"; }
                    else if(gun == 31) { ftext = "M4"; }
                    else if(gun == 32) { ftext = "Tec9"; }
                    else if(gun == 33) { ftext = "Country Rifle"; }
                    else if(gun == 34) { ftext = "Sniper Rifle"; }
                    else if(gun == 35) { ftext = "Rocket Launcher"; }
                    else if(gun == 36) { ftext = "HS Rocket Launcher"; }
                    else if(gun == 37) { ftext = "Flamethrower"; }
                    else if(gun == 38) { ftext = "Minigun"; }
                    else if(gun == 41) { ftext = "Spraycan"; }
                    else if(gun == 42) { ftext = "Fire Extinguisher"; }
                    else if(gun == 43) { ftext = "Camera"; }
                    else if(gun == 44) { ftext = "Nightvision Goggle"; }
                    else if(gun == 45) { ftext = "Thermal Goggles"; }
                    else if(gun == 46) { ftext = "Parachutte"; }
                    new ammo;
                    gun = strval(tmp);
                    if(gun < 1||gun > 46||gun==27||gun==1||gun==2||gun==9||gun==17||gun==19||gun==20||gun==21||gun==36||gun==38||gun==39||gun==40||gun==44||gun==45)
                    { SendClientMessage(playerid, COLOR_GRAD1, "  wrong WeaponID!"); return 1; }
                    ammo = strval(tmp);
                    if(ammo <1 ||ammo > 999)
                    { SendClientMessage(playerid, COLOR_GRAD1, "  dont go below 1 or above 999 bullets!"); return 1; }
                    for(new i;i<MAX_PLAYERS;i++)
                    {
                      GivePlayerWeapon(i, gun, ammo);
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, 256, "You have received a %s with %d ammo from admin %s.",ftext,ammo,sendername);
                        SendClientMessage(i,0xC84200AA,string);
                        format(string, 256, "[EVENT]: %s has gived a %s with %d ammo.",sendername,ftext,ammo);
                        SendClientMessageToAll(COLOR_LIGHTRED, string);
                      return 1;
                    }
                }
            }
        }
        return 1;
    }
What's wrong?

I type /event guns 24 100 and I receive a Deagle with 24 ammo not with 100, why?
Reply


Messages In This Thread
/event problem. - by Razvann - 26.02.2010, 18:58
Re: /event problem. - by Jeffry - 26.02.2010, 19:19
Re: /event problem. - by notime - 26.02.2010, 23:16
Re: /event problem. - by Razvann - 27.02.2010, 13:24
Re: /event problem. - by Jeffry - 27.02.2010, 13:26
Re: /event problem. - by Razvann - 27.02.2010, 13:29
Re: /event problem. - by Vince - 27.02.2010, 13:37
Re: /event problem. - by Jeffry - 27.02.2010, 15:35
Re: /event problem. - by Razvann - 27.02.2010, 15:49

Forum Jump:


Users browsing this thread: 1 Guest(s)