SA-MP Forums Archive
Weapon. - 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: Weapon. (/showthread.php?tid=366471)



Weapon. - budelis - 06.08.2012

Код:
COMMAND:weapon(playerid, params[]) // or CMD:mycommand(playerid, params[])
{
	new ID, Amount;
	if (sscanf(params, "ud", ID, Amount)){SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /weapon [partofname] [ammount]");return 1;}
	if (ID == INVALID_PLAYER_ID){SendClientMessage(playerid, COLOR_RED, "This player do not exist.");return 1;}
	if( ID == playerid ) { SendClientMessage( playerid, COLOR_RED,"* You can't do this."); return 1;}
	new ammo = GetPlayerAmmo(playerid);
	new weapon = GetPlayerWeapon(playerid);
I want to check player all guns slots. If my gun slot is same like player who i will give a gun is same, then i want to set my variable.

EX: i have gun M4. ( this weapon is in 6 slot i think is not important ).

Other player who i will give this weapon he have AK-47,deagle,shotgun. (AK-47 slot is same like M-4).

Then i want to set this variable:

Код:
GUNSANTICHEATS[ ID ][ GUN ID ( IT WILL BE NOW AK-47 ID ) ] = false;
GUNSANTICHEATS[ ID ][ GUN ID ( IT WILL BE NOW M-4 ID ) ] = true;



Re: Weapon. - budelis - 07.08.2012

anyhelp?


Re: Weapon. - ZBits - 07.08.2012

Maybe if you will do GivePlayerWeapon(playerid,31) it will automaticly replace

+rep if i helped


Re: Weapon. - budelis - 07.08.2012

But i want to set variable. Because if i give player M4 and player will have with self AK-47 then he will not have a AK-47 and i want to set my variable to set this weapon to false, and M4 to true.


Re: Weapon. - Universal - 07.08.2012

So whats the problem? I dont really get it.


Re: Weapon. - budelis - 07.08.2012

Player can cheat now he can get AK-47. Fixed.