SA-MP Forums Archive
/giveweapon and oen little question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /giveweapon and oen little question (/showthread.php?tid=348052)



/giveweapon and oen little question - Geniuss - 04.06.2012

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


Re: /giveweapon and oen little question - Yuryfury - 04.06.2012

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.