public OnPlayerStateChange(playerid, newstate, oldstate)
{
new armas[MAX_PLAYERS][12], balas[MAX_PLAYERS][12];
if(newstate == PLAYER_STATE_DRIVER)
{
for(new slot; slot != 12; slot++)
{
GetPlayerWeaponData(playerid, 5, armas[playerid][slot], balas[playerid][slot]);
}
ResetPlayerWeapons(playerid);
return 1;
}
if(newstate == PLAYER_STATE_ONFOOT)
{
for(new slot; slot != 12; slot++)
{
GivePlayerWeapon(playerid, armas[playerid][slot], balas[playerid][slot]);
}
return 1;
}
return 1;
}
new armas[MAX_PLAYERS][13];
public OnPlayerStateChange(playerid, newstate, oldstate) { new armas[MAX_PLAYERS][12], balas[MAX_PLAYERS][12]; if(newstate == PLAYER_STATE_DRIVER) { for(new slot; slot != 12; slot++) { GetPlayerWeaponData(playerid, 5, armas[playerid][slot], balas[playerid][slot]); } ResetPlayerWeapons(playerid); return 1; } if(newstate == PLAYER_STATE_ONFOOT) { for(new slot; slot != 12; slot++) { GivePlayerWeapon(playerid, armas[playerid][slot], balas[playerid][slot]); } return 1; } return 1; }
public OnPlayerStateChange(playerid, newstate, oldstate) { new armas[MAX_PLAYERS][12], balas[MAX_PLAYERS][12]; if(newstate == PLAYER_STATE_DRIVER) { for(new slot; slot != 12; slot++) { GetPlayerWeaponData(playerid, 5, armas[playerid][slot], balas[playerid][slot]); } ResetPlayerWeapons(playerid); return 1; } if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER) { for(new slot; slot != 12; slot++) { GivePlayerWeapon(playerid, armas[playerid][slot], balas[playerid][slot]); } return 1; } return 1; }
Originally Posted by lukitaxxx_samp
Y con respecto a esto.. modificale una cosa:
Код:
public OnPlayerStateChange(playerid, newstate, oldstate) { new armas[MAX_PLAYERS][12], balas[MAX_PLAYERS][12]; if(newstate == PLAYER_STATE_DRIVER) { for(new slot; slot != 12; slot++) { GetPlayerWeaponData(playerid, 5, armas[playerid][slot], balas[playerid][slot]); } ResetPlayerWeapons(playerid); return 1; } if(newstate == PLAYER_STATE_ONFOOT) { for(new slot; slot != 12; slot++) { GivePlayerWeapon(playerid, armas[playerid][slot], balas[playerid][slot]); } return 1; } return 1; } ponele esto: Код:
public OnPlayerStateChange(playerid, newstate, oldstate) { new armas[MAX_PLAYERS][12], balas[MAX_PLAYERS][12]; if(newstate == PLAYER_STATE_DRIVER) { for(new slot; slot != 12; slot++) { GetPlayerWeaponData(playerid, 5, armas[playerid][slot], balas[playerid][slot]); } ResetPlayerWeapons(playerid); return 1; } if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER) { for(new slot; slot != 12; slot++) { GivePlayerWeapon(playerid, armas[playerid][slot], balas[playerid][slot]); } return 1; } return 1; } |
forward GodT();
SetTimer("GodT", 1, 1);
public GodT()
{
for(new i=0; i<MAX_PLAYERS; i++){
new Arma = GetPlayerWeapon(i);
if(IsPlayerConnected(i) && Arma == 0){
SetPlayerHealth(i, 100000);
}
}
}