Gun dosent come back.. - 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: Gun dosent come back.. (
/showthread.php?tid=120774)
Gun dosent come back.. -
Snyper18 - 13.01.2010
So yeah, I have this code that re-sets the weapon if a player has one.
Quote:
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1545.8363,-1678.9054,13.8754)) // Court Doors
{
if(GetPlayerWeapon(playerid) == 24)
{
SendClientMessage(playerid,0xFFFFFFFF,"Works");
for(new s; s < 13; s++)
{
for(new w; w < 46; w++)
{
if (PlayerWeaponInfo[playerid][w] > 0)
{
PlayerWeapon[playerid] = w;
GivePlayerGun(playerid, w, 1);
PlayerWeaponInfo[playerid][w] = GetPlayerAmmo(playerid)-1;
courtgun = AddStaticPickup(348, 1, 1535.7446,-1682.0582,13.5469, 0);
}
}
}
ResetPlayerWeapons(playerid);
for(new w; w < 13; w++)
{
PlayerWeapon[playerid][w] = 0;
}
}
|
I have this code also, making a pickup which I want to re-set the weapon and ammo they had..
Quote:
if (pickupid == courtgun) //
{
new tmp[256];
new weaponid = GetWeaponID(tmp);
for(new s; s < 13; s++)
{
for(new w; w < 13; w++)
{
GivePlayerGun(playerid, weaponid, PlayerWeaponInfo[playerid][weaponid]);
PlayerWeapon[playerid][w] = weaponid;
SendClientMessage(playerid, COLOR_WHITE, "WORKS");
}
return 1;
}
}
|
- Note : When I run threw the icon, nothing happens..
Re: Gun dosent come back.. -
Roytjuh - 13.01.2010
Could be serveral problems :
-Courtgun could be defined wrong
-Wrong pickuptype ( you have the pickuptype on Not Pickable, not changable)
-Why should you use a loop in a loop? (1 for ammo, 1 for weapon?)
-Also , we are getting a little bit to less information,
Does the server show yo "works"?
Greetz Roy