Posts: 33
Threads: 11
Joined: Oct 2013
Reputation:
0
hi guys
i need help reseting only on weapon from weapon slot
I know GetPlayerWeaponData I dont know how it works.
Can someone give me example of this
Removing a deagle and replacing that with colt
in a weapons slot.
Posts: 305
Threads: 52
Joined: Mar 2012
Reputation:
0
If you're giving the same weapon, with the same slot. It will replace your secondary slot.
Posts: 33
Threads: 11
Joined: Oct 2013
Reputation:
0
I am making a taser system!
^ The one you posted it removes my gun and It dont let me use De Eagle, can you see what i did wrong
else if(Tazer[playerid] == 1)
{
new GunSlot2ID, GunSlot2AmmoID; // Declare the variables for the weapon slot (in our case, 2) weapon ID and Ammo ID you are going to retrieve.
GetPlayerWeaponData(playerid, 2, GunSlot2ID, GunSlot2AmmoID); // Get the player-in-question's "pistol" weapon ID and ammo in slot 2, using the variables declared.
if(GunSlot2ID == 22) // If the player's "pistol" weapon is a Desert Eagle...
{
GivePlayerWeaponEx(playerid, 24, GunSlot2AmmoID); // ... Give the player a Colt (automatically replacing the "pistol" weapon slot) and give the player the ammunition they previously had for the Desert Eagle.
}
Tazer[playerid] = 0;
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}
else Tazer[playerid] = 0;
return 1;
}
}
so if someone does /taser at first time it gives them colt
again they do taser i want them to replace colt with sd pistol
I did this way but it dont let me switch to my sd pistol and cant scroll down and shti
Posts: 104
Threads: 2
Joined: Dec 2010
Reputation:
0
You cannot hold more than one weapon in the same weapon slot, thus you cannot have a Colt and a Desert Eagle at one instance. Could you provide the code for the entire /tazer command? Wrap [pawn] tags around your code, please.