/giveweapon and oen little question
#1

So i am trying to make it so when you do /giveweapon the other person has to accept it buy im getting stuck this is what i have could you help me a little bit please the person that is selling has to be holding it

In my enum

pawn Код:
PendingGun
pawn Код:
command(giveweapon, playerid, params[])
{
    new string[128], id, WeaponName[128];
    if(sscanf(params, "uz", id, WeaponName))
    {
        SendClientMessage(playerid, WHITE, "SYNTAX: /giveweapon [playerid] [usage]");
        SendClientMessage(playerid, WHITE, "Usages: SilencedPistol, AK47, PumpActionShotgun, MP5");
    }
    else
    {
        if(IsPlayerConnectedEx(id))
        {
            if(GetDistanceBetweenPlayers(id, playerid) < 7 && !IsPlayerInAnyVehicle(playerid))
            {
                if(strcmp(WeaponName, "silencedpistol", true) == 0)
                {
                    if(Player[playerid][WepSlot2] == 23)
                    {
                        format(string, sizeof(string), "You have offered %s a %s.", GetName(id), WeaponName);
                        SendClientMessage(playerid, WHITE, string);
                        format(string, sizeof(string), "You have been offered weapon %s, by %s.", WeaponName, GetName(playerid));
                        SendClientMessage(id, WHITE, string);
                        Player[id][PendingGun] = 1;
                    }
                }
           }
       }
}
pawn Код:
command(acceptgun, playerid, params[])
{
    if(Player[playerid][PendingGun] == 1)
    {
How would i carry that on


Also a little question

How can i stop people shooting out the passenger seat with guns ?

Thanks

Help is Appreciated
Reply
#2

I would instead set PendingGun to the weaponid. Then, in the accept command, if PendingGun!=0, give them the weapon (id = PendingGun) and reset PendingGun to zero.

As for your other question, just search for an anti-driveby filterscript.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)