08.10.2010, 15:28
Can you make that when you enter a vehicle as driver your armed weapon changes to fists/hand?
new PlayerWeaponDetails[MAX_PLAYERS][13][2];
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER /*|| newstate == PLAYER_STATE_PASSENGER*/) //Just remove the ''/*'' ''*/'' and it works for Passenger too.
{
for (new i = 0; i < 13; i++) PlayerWeaponDetails[playerid][i][0]=0, PlayerWeaponDetails[playerid][i][1]=0;
for (new i = 0; i < 13; i++) GetPlayerWeaponData(playerid, i, PlayerWeaponDetails[playerid][i][0], PlayerWeaponDetails[playerid][i][1]);
ResetPlayerWeapons(playerid);
}
if(oldstate == PLAYER_STATE_DRIVER /*|| newstate == PLAYER_STATE_PASSENGER*/) //Same here.
{
if(newstate == PLAYER_STATE_ONFOOT)
{
for (new i = 0; i < 13; i++) GivePlayerWeapon(playerid, PlayerWeaponDetails[playerid][i][0], PlayerWeaponDetails[playerid][i][1]);
}
}
return 1;
}