Put guns in car Trunk
#1

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.
Reply
#2

You code is right.
Loka't Complete bug list
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)