What's wrong with this command?
#1

pawn Код:
CMD:giveweapon(playerid, params[])
{
    new giveplayerid, weapon, ammo;
    if(sscanf(params, "uii", giveplayerid, weapon, ammo)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /giveweapon [playerid] [weaponid] [ammo]");

    GivePlayerWeapon(giveplayerid, weapon, ammo);
    return 1;
}
Only gives to ID 0.
Reply
#2

Try that and see what it results.
pawn Код:
CMD:giveweapon(playerid, params[])
{
    new giveplayerid, weapon, ammo;
    if(sscanf(params, "uii", giveplayerid, weapon, ammo)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /giveweapon [playerid] [weaponid] [ammo]");
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,COLOR_GREY,"Player is not connected.");
    GivePlayerWeapon(giveplayerid, weapon, ammo);
    return 1;
}
Reply
#3

I'm using this one
pawn Код:
CMD:giveweapon(playerid, params[])
{
    if(AdminDuty[playerid] == 1)
        return SendClientMessage(playerid,COLOR_WHITE, "You can't use this command while on-duty as admin.");
       
    if(GetPVarInt(playerid, "PBM") > 0)
        return SendClientMessage(playerid, COLOR_WHITE, "You're not able to do this while in a paintball game.");
       
    if(GetPVarInt(playerid, "EventToken") != 0)
        return SendClientMessage(playerid, COLOR_GREY, "You can't use this while you're in an event.");
       
    if(GetPVarInt(playerid, "Injured") != 0||PlayerCuffed[playerid]!=0||GetPVarInt(playerid, "Hospital")!=0||GetPlayerState(playerid) == 7)
        return SendClientMessage (playerid, COLOR_GRAD2, "You can't do this at this time.");
       
    if(IsPlayerInAnyVehicle(playerid))
        return SendClientMessage (playerid, COLOR_GRAD2, "You can't give weapons in a vehicle!");

    new
        Float:health,
        string[128];
       
    GetPlayerHealth(playerid, health);
   
    if(health < 80)
        return SendClientMessage(playerid, COLOR_GRAD1, "You can't give weapons if your health is below 80!");

    if(GetPVarInt(playerid, "GiveWeaponTimer") > 0) {
        format(string, sizeof(string), "You must wait %d seconds before giving another weapon.", GetPVarInt(playerid, "GiveWeaponTimer"));
        SendClientMessage(playerid,COLOR_GREY,string);
        return true;
    }

    new
        giveplayerid,
        weapon[64];
       
    if(sscanf(params, "us[64]", giveplayerid, weapon)) {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /giveweapon [playerid/partofname] [weapon name]");
        SendClientMessage(playerid, COLOR_GRAD2, "Available Names: sdpistol, shotgun, 9mm, mp5, uzi, tec9, rifle, deagle, ak47, m4, spas12, sniper");
        SendClientMessage(playerid, COLOR_GRAD2, "Available Names: flowers, knuckles, baseballbat, cane, shovel, poolcue, golfclub, katana, dildo, parachute");
        return true;
    }
   
    if(PlayerInfo[playerid][pDonator] >= 3 && PlayerInfo[giveplayerid][pDonator] < 3)
        return SendClientMessage(playerid, COLOR_WHITE, "You can't use this command as Diamond Donator due to your access to the black market.");

    if(giveplayerid == INVALID_PLAYER_ID)
        return SendClientMessage(playerid, COLOR_GREY, "You can't give a weapon to this player as they're not connected.");

    if(IsPlayerInAnyVehicle(giveplayerid))
        return SendClientMessage (playerid, COLOR_GRAD2, "You can't give weapons to players in vehicles!");
       
    if(giveplayerid == playerid)
        return SendClientMessage(playerid, COLOR_GRAD1, "You can't give a weapon to yourself!");
       
    if(!ProxDetectorS(3.0, playerid, giveplayerid))
        return SendClientMessage(playerid, COLOR_GREY, "That player isn't near you.");
       
    if(PlayerInfo[giveplayerid][pFaction] == 0 && PlayerInfo[playerid][pFaction] > 0 || PlayerInfo[playerid][pFaction] == 4)
        return SendClientMessage(playerid, COLOR_GRAD1, "You can't give weapons to players not in a faction or hitman!");

    if(PlayerInfo[giveplayerid][pConnectTime] < 2)
        return SendClientMessage(playerid, COLOR_GRAD2, "That player is currently restricted from possessing weapons");
       
    if(IsPlayerInAnyVehicle(giveplayerid))
        return SendClientMessage(playerid, COLOR_GRAD2, "Please exit the vehicle, before using this command.");

    if(strcmp(weapon, "9mm", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][2] == 22)
        {
            if(PlayerInfo[giveplayerid][pGuns][2] != 22 && PlayerInfo[giveplayerid][pGuns][2] != 23 && PlayerInfo[giveplayerid][pGuns][2] != 24)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your 9mm pistol.");
                format(string, sizeof(string), "* %s has given %s their 9mm pistol.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                RemovePlayerWeapon(playerid, 22);
                GivePlayerValidWeapon(giveplayerid, 22, 60000);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "That player already has a similar weapon!");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "sdpistol", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][2] == 23)
        {
            if(PlayerInfo[giveplayerid][pGuns][2] != 22 && PlayerInfo[giveplayerid][pGuns][2] != 23 && PlayerInfo[giveplayerid][pGuns][2] != 24)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your silenced pistol.");
                format(string, sizeof(string), "* %s has given %s their silenced pistol.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                RemovePlayerWeapon(playerid, 23);
                GivePlayerValidWeapon(giveplayerid, 23, 60000);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "That player already has a similar weapon!");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "deagle", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][2] == 24)
        {
            if(PlayerInfo[giveplayerid][pGuns][2] != 22 && PlayerInfo[giveplayerid][pGuns][2] != 23 && PlayerInfo[giveplayerid][pGuns][2] != 24)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your Desert Eagle.");
                format(string, sizeof(string), "* %s has given %s their Desert Eeagle.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                RemovePlayerWeapon(playerid, 24);
                GivePlayerValidWeapon(giveplayerid, 24, 60000);
                SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "That player already has a similar weapon!");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "shotgun", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][3] == 25)
        {
            if(PlayerInfo[giveplayerid][pGuns][3] != 25 && PlayerInfo[giveplayerid][pGuns][3] != 27)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your shotgun.");
                format(string, sizeof(string), "* %s has given %s their shotgun.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                RemovePlayerWeapon(playerid, 25);
                GivePlayerValidWeapon(giveplayerid, 25, 60000);
                SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "That player already has a similar weapon!");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "spas12", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][3] == 27)
        {
            if(PlayerInfo[giveplayerid][pGuns][3] != 25 && PlayerInfo[giveplayerid][pGuns][3] != 27)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your SPAS-12.");
                format(string, sizeof(string), "* %s has given %s their SPAS-12.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                RemovePlayerWeapon(playerid, 27);
                GivePlayerValidWeapon(giveplayerid, 27, 60000);
                SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "That player already has a similar weapon!");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "mp5", true) == 0) {
        if(PlayerInfo[playerid][pGuns][4] == 29)
        {
            if(PlayerInfo[giveplayerid][pGuns][4] != 28 && PlayerInfo[giveplayerid][pGuns][4] != 29 && PlayerInfo[giveplayerid][pGuns][4] != 32)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your MP5.");
                format(string, sizeof(string), "* %s has given %s their MP5.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                RemovePlayerWeapon(playerid, 29);
                GivePlayerValidWeapon(giveplayerid, 29, 60000);
                SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "That player already has a similar weapon!");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "uzi", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][4] == 28)
        {
            if(PlayerInfo[giveplayerid][pGuns][4] != 28 && PlayerInfo[giveplayerid][pGuns][4] != 29 && PlayerInfo[giveplayerid][pGuns][4] != 32)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your Micro SMG.");
                format(string, sizeof(string), "* %s has given %s their Micro SMG.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                RemovePlayerWeapon(playerid, 28);
                GivePlayerValidWeapon(giveplayerid, 28, 60000);
                SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "That player already has a similar weapon!");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "tec9", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][4] == 32)
        {
            if(PlayerInfo[giveplayerid][pGuns][4] != 28 && PlayerInfo[giveplayerid][pGuns][4] != 29 && PlayerInfo[giveplayerid][pGuns][4] != 32)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your Tec-9.");
                format(string, sizeof(string), "* %s has given %s their Tec-9.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                RemovePlayerWeapon(playerid, 32);
                GivePlayerValidWeapon(giveplayerid, 32, 60000);
                SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "That player already has a similar weapon!");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "ak47", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][5] == 30)
        {
            if(PlayerInfo[giveplayerid][pGuns][5] != 30 && PlayerInfo[giveplayerid][pGuns][5] != 31)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your AK-47.");
                format(string, sizeof(string), "* %s has given %s their AK-47.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                RemovePlayerWeapon(playerid, 30);
                GivePlayerValidWeapon(giveplayerid, 30, 60000);
                SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "That player already has a similar weapon!");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "m4", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][5] == 31)
        {
            if(PlayerInfo[giveplayerid][pGuns][5] != 30 && PlayerInfo[giveplayerid][pGuns][5] != 31)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your M4.");
                format(string, sizeof(string), "* %s has given %s their M4.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                RemovePlayerWeapon(playerid, 31);
                GivePlayerValidWeapon(giveplayerid, 31, 60000);
                SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "That player already has a similar weapon!");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "rifle", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][6] == 33)
        {
            if(PlayerInfo[giveplayerid][pGuns][6] != 33 && PlayerInfo[giveplayerid][pGuns][6] != 34)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your rifle.");
                format(string, sizeof(string), "* %s has given %s their rifle.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                RemovePlayerWeapon(playerid, 33);
                GivePlayerValidWeapon(giveplayerid, 33, 60000);
                SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "That player already has a similar weapon!");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
   
    else if(strcmp(weapon, "sniper", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][6] == 34)
        {
            if(PlayerInfo[giveplayerid][pGuns][6] != 33 && PlayerInfo[giveplayerid][pGuns][6] != 34)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your sniper rifle.");
                format(string, sizeof(string), "* %s has given %s their sniper rifle.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                RemovePlayerWeapon(playerid, 34);
                GivePlayerValidWeapon(giveplayerid, 34, 60000);
                SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "That player already has a similar weapon!");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "flowers", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][10] == 14)
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your flowers.");
            format(string, sizeof(string), "* %s has given %s their flowers.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            RemovePlayerWeapon(playerid, 14);
            GivePlayerValidWeapon(giveplayerid, 14, 60000);
            SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "knuckles", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][0] == 1)
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your brass knuckles.");
            format(string, sizeof(string), "* %s has given %s their brass knuckles.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            RemovePlayerWeapon(playerid, 1);
            GivePlayerValidWeapon(giveplayerid, 1, 60000);
            SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "baseballbat", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][1] == 5)
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your baseball bat.");
            format(string, sizeof(string), "* %s has given %s their baseball bat.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            RemovePlayerWeapon(playerid, 5);
            GivePlayerValidWeapon(giveplayerid, 5, 60000);
            SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "cane", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][10] == 15)
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your cane.");
            format(string, sizeof(string), "* %s has given %s their cane.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            RemovePlayerWeapon(playerid, 15);
            GivePlayerValidWeapon(giveplayerid, 15, 60000);
            SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "shovel", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][6] == 6)
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your shovel.");
            format(string, sizeof(string), "* %s has given %s their shovel.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            RemovePlayerWeapon(playerid, 6);
            GivePlayerValidWeapon(giveplayerid, 6, 60000);
            SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "golfclub", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][1] == 2)
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your golf club.");
            format(string, sizeof(string), "* %s has given %s golf club.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            RemovePlayerWeapon(playerid, 2);
            GivePlayerValidWeapon(giveplayerid, 2, 60000);
            SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "katana") == 0)
    {
        if(PlayerInfo[playerid][pGuns][1] == 8)
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your katana.");
            format(string, sizeof(string), "* %s has given %s their katana.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            RemovePlayerWeapon(playerid, 8);
            GivePlayerValidWeapon(giveplayerid, 8, 60000);
            SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "dildo", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][10] == 10)
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your dildo.");
            format(string, sizeof(string), "* %s has given %s their dildo.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            RemovePlayerWeapon(playerid, 10);
            GivePlayerValidWeapon(giveplayerid, 10, 60000);
            SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else if(strcmp(weapon, "parachute", true) == 0)
    {
        if(PlayerInfo[playerid][pGuns][11] == 46)
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have given away your parachute.");
            format(string, sizeof(string), "* %s has given %s their parachute.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            RemovePlayerWeapon(playerid, 46);
            GivePlayerValidWeapon(giveplayerid, 46, 60000);
            SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TIMER_GIVEWEAPON);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You do not have that weapon!");
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_GRAD1, "You have entered an invalid weapon name.");
    }

    return true;
}
But i'm not sure it works with your script.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)