SA-MP Forums Archive
[System] Protect Player Shoot on the cars for Roleplay - 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: [System] Protect Player Shoot on the cars for Roleplay (/showthread.php?tid=383818)



[System] Protect Player Shoot on the cars for Roleplay - bigtigerbeee - 09.10.2012

OnPlayerStateChange

Код:
	if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
	{
		new Weap[2];
		GetPlayerWeaponData(playerid, 4, Weap[0], Weap[1]);
		SetPlayerArmedWeapon(playerid, Weap[0]);
       }
Player can't shoot on the cars


Re: [System] Protect Player Shoot on the cars for Roleplay - park4bmx - 09.10.2012

PHP код:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)//if the player enter's a veh.
    
{
        new 
Weap[2];
        
GetPlayerWeaponData(playerid4Weap[0], Weap[1]);
        
SetPlayerArmedWeapon(playeridWeap[0]);
       }