Gun dosent come back..
#1

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)