Admin command to giveweapon
#5

First thank you for helping me.

I understand what you mean, but I done much to the gamemod without zcmd, I can't re-do one.

I tried to "translate" and understand what you gave me into "without zcmd" language.

pawn Код:
if(strcmp(cmd, "/agiveweapon", true) == 0)
    {
            if(logged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be logged in.");
            return 1;
        }
       
            if(PlayerInfo[playerid][pAdmin] < 1)
        {
            SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not allowed to use this command!");
            return 1;
        }
           new targetid = giveplayerid;
           new weaponid;
           new ammo;
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /agiveweapon [id] [arme] [munitions]");
            return 1;
        }
        if (IsPlayerConnected(targetid))
    {
            new targetName[MAX_PLAYER_NAME];
            new weaponName[32];
            GetPlayerName(targetid, targetName, sizeof targetName);
            GetWeaponName(weaponid, weaponName, sizeof weaponName);
            GivePlayerWeapon(targetid, weaponid, ammo);
            format(string, sizeof(string), "You have given %s a %s with %d ammo.", targetName, weaponName, ammo);
            SendClientMessage(playerid, COLOR_ORANGE, string);
            return 1;
    }
        else
    {
            format(string, sizeof(string), "ID:%d is not an active player.", targetid);
            SendClientMessage(playerid, COLOR_BRIGHTRED, string);
    }
   
    return 1;
}
No errors but doesn't work whatever I'm writing:

Reply


Messages In This Thread
[FIXED] Admin command to giveweapon - by Adamsy - 13.08.2016, 13:16
Re: Admin command to giveweapon - by oMa37 - 13.08.2016, 13:49
Re: Admin command to giveweapon - by Adamsy - 13.08.2016, 14:12
Re: Admin command to giveweapon - by Vince - 13.08.2016, 14:21
Re: Admin command to giveweapon - by Adamsy - 13.08.2016, 23:23
Re: Admin command to giveweapon - by Dayrion - 14.08.2016, 00:00
Re: Admin command to giveweapon - by Adamsy - 14.08.2016, 01:48
Re: Admin command to giveweapon - by Shinja - 14.08.2016, 02:46
Re: Admin command to giveweapon - by Adamsy - 14.08.2016, 03:15
Re: Admin command to giveweapon - by Shinja - 14.08.2016, 11:37

Forum Jump:


Users browsing this thread: 1 Guest(s)