13.09.2012, 21:15
Quote:
Eso no funcionara, simplemente por que no le remueves las armas y por que la segunda condicion JAMAS se cumplira, ademas no se necesita quitarle las armas, solo con cambiar el arma equipada basta
|
Codigo arreglado:
pawn Код:
new bool:Driving[MAX_PLAYERS], Weapons[MAX_PLAYERS][13][2];
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
for(new i; i<13; i++)
{
GetPlayerWeaponData(playerid, i, Weapons[playerid][i][0], Weapons[playerid][i][1]);
}
ResetPlayerWeapons(playerid);
Driving[playerid] = true;
}
else if(Driving[playerid] && (newstate == PLAYER_STATE_ONFOOT))
{
for(new i; i<13; i++)
{
GivePlayerWeapon(playerid, Weapons[playerid][i][0], Weapons[playerid][i][1]);
}
Driving[playerid] = false;
}
return 1;
}