public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new weapons[13][2];
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
}
SetPlayerArmedWeapon(playerid, 0);
if(newstate == PLAYER_STATE_ONFOOT && PLAYER_STATE_PASSENGER)
{
for( new i; i < 13; i++)
{
SetPlayerArmedWeapon(playerid, 31) && SetPlayerArmedWeapon(playerid, 29) && SetPlayerArmedWeapon(playerid, 28) && SetPlayerArmedWeapon(playerid, 32);
}
}
return 1;
}
if(newstate == PLAYER_STATE_DRIVER)
if(newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER)
SetPlayerArmedWeapon(playerid, 29)
Replace
pawn Код:
pawn Код:
|
Try to set ONE only, For example
Код:
SetPlayerArmedWeapon(playerid, 29) |
if(newstate==PLAYER_STATE_PASSENGER)
{
new gun,tmpaa;
GetPlayerWeaponData(playerid,4,gun,tmpaa);
#pragma unused tmpaa
if(gun != 28 || gun != 29 || gun != 32 || gun != 31) SetPlayerArmedWeapon(playerid,0);
else SetPlayerArmedWeapon(playerid,gun);
}
My bad i read it wrong, try
pawn Код:
|
if(newstate == PLAYER_STATE_DRIVER)
{
new weapons[13][2];
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
}
SetPlayerArmedWeapon(playerid, 0);
if(newstate==PLAYER_STATE_PASSENGER)
{
new gun,tmpaa;
GetPlayerWeaponData(playerid,4,gun,tmpaa);
#pragma unused tmpaa
if(gun != 28 || gun != 29 || gun != 32 || gun != 31) SetPlayerArmedWeapon(playerid,0);
else SetPlayerArmedWeapon(playerid,gun);
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate==PLAYER_STATE_PASSENGER)
{
new gun,tmpaa;
GetPlayerWeaponData(playerid,4,gun,tmpaa);
#pragma unused tmpaa
if(gun != 28 || gun != 29 || gun != 32 || gun != 31) SetPlayerArmedWeapon(playerid,0);
else SetPlayerArmedWeapon(playerid,gun);
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
switch(ispassenger)
{
case 1:
{
new
curWeapon = GetPlayerWeapon(playerid);
if(curWeapon != 28 || curWeapon != 29 || curWeapon != 32 || curWeapon != 31) SetPlayerArmedWeapon(playerid, 0);
}
default: SetPlayerArmedWeapon(playerid, 0);
}
return 1;
}