need help , bug on mixing dropgun to gamemode. - 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: need help , bug on mixing dropgun to gamemode. (
/showthread.php?tid=466817)
need help , bug on mixing dropgun to gamemode. -
Ivander - 29.09.2013
as the tittle say , i got some problem after mixing Dropgun FS by PeteShag
after i do /dropgun , its working nicely
but after i drop it , and i do /pickupgun the gun is not on my hand and just say "Ivander has bla bla"
Код:
CMD:pickupgun(playerid, params[])
{
new sendername[MAX_PLAYER_NAME];
new string[128];
if(PlayerInfo[playerid][pConnectTime] < 2 || PlayerInfo[playerid][pWRestricted] > 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You're currently restricted from possessing weapons!");
for(new i = 0; i < sizeof(DropInfo); i++)
{
if (IsPlayerInRangeOfPoint(playerid, 2.0,DropInfo[i][DropGunPosX],DropInfo[i][DropGunPosY],DropInfo[i][DropGunPosZ]))
{
if(GetPlayerVirtualWorld(playerid) == DropInfo[i][DropGunVWorld] && GetPlayerInterior(playerid) == DropInfo[i][DropGunVWorld])
{
GetPlayerName(playerid, sendername, sizeof(sendername));
DestroyDynamicObject(DropObject[i]);
DropInfo[i][DropGunPosX] = 0.0;
DropInfo[i][DropGunPosY] = 0.0;
DropInfo[i][DropGunPosZ] = 0.0;
DropInfo[i][DropGunAmmount][0] = 0;
DropInfo[i][DropGunAmmount][1] = 0;
GivePlayerValidWeapon(playerid,DropInfo[i][DropGunAmmount][0],60000);
format(string, sizeof(string), "* %s picks up a weapon from the ground.", sendername);
SendLocalMessage(playerid, string, 10.0, COLOR_PURPLE, COLOR_PURPLE);
return 1;
}
}
}
return 1;
}
what i miss on that code ?
Re: need help , bug on mixing dropgun to gamemode. -
Krakuski - 29.09.2013
Its probably because you gave the player 60,000 ammo, lower it down to 9999 and tell me if it works.