SA-MP Forums Archive
Put guns in car Trunk - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Put guns in car Trunk (/showthread.php?tid=88525)



Put guns in car Trunk - benlevi - 27.07.2009

Hello,

I did this command:

Quote:

if(strcmp(cmd, "/putgun", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pDonateRank] >= 2)
{
new gunID = GetPlayerWeapon(playerid);
new gunAmmo = GetPlayerAmmo(playerid);
PutGunA[GetClosestCar(playerid)] = gunAmmo;
PutGun[GetClosestCar(playerid)] = gunID;
GivePlayerWeapon(playerid, gunID, -gunAmmo);
}
}
return 1;
}

if(strcmp(cmd, "/takegun", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pDonateRank] >= 2)
{
GivePlayerWeapon(playerid, PutGun[GetClosestCar(playerid)],PutGunA[GetClosestCar(playerid)]);
PutGunA[GetClosestCar(playerid)] = 0;
PutGun[GetClosestCar(playerid)] = 0;
}

}
return 1;
}

/putgun working great.
but when i want to take the gun, its doesn't give me the gun back.


Thank you.



Re: Put guns in car Trunk - yezizhu - 27.07.2009

You code is right.
Loka't Complete bug list