Posts: 498
Threads: 233
Joined: Aug 2013
Reputation:
0
How to make like:
I have gun and i changed to another gun,then it will auto change my gun to the old one example:
I have spas and deagle and i was holding spas and then changed to deagle, it will change it back to spas
And it can be another guns because i dont know what guns the player has so how to know the weapon he had?
Posts: 498
Threads: 233
Joined: Aug 2013
Reputation:
0
You can give me the code ? I have made everything and a timer but i need a code to know the gun he used and then onplayerupdate i will put his armed weapon to the id of that gun like
[pawn]
new WeapID
Getplayergun(playerid)
How to use the WeapID so it will be the X id of the gun? And then i can use it on playerupdate
Posts: 498
Threads: 24
Joined: Apr 2013
you can use this one:
PHP код:
public OnPlayerUpdate(playerid)
{
new iCurWeap = GetPlayerWeapon(playerid);
if(iCurWeap != GetPVarInt(playerid, "iCurrentWeapon"))
{
OnPlayerChangeWeapon(playerid, GetPVarInt(playerid, "iCurrentWeapon"), iCurWeap);
SetPVarInt(playerid, "iCurrentWeapon", iCurWeap);
}
return 1;
}
stock OnPlayerChangeWeapon(playerid, oldweapon, newweapon)
{
SetPlayerAmmo(playerid, newweapon, -1);
SendClientMessage(playerid, 0xFFFFFFFF, "You Can't Chagne Your Weapon!");
}
Posts: 498
Threads: 233
Joined: Aug 2013
Reputation:
0
let me tell you what i want,i am making a thing like:
if i shot using shotgun and i have deagle,and i change my weapon to deagle it will let me hold the shotgun again till the timer is over,i have made a timer,but how to let him get the weapon he used to shoot?