[AYUDA] Limitar uso del boton a 7
#4

En realidad para que esto de resultado, necesitamos crear una variable disponible para todos los jugadores, por lo que ese codigo cambiarнa a:

pawn Код:
new Botella[MAX_PLAYERS];
pawn Код:
if(strcmp(cmd, "/beber", true) == 0)
{
  SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
  SendClientMessage(playerid, COLOR, "Advertencia: Cuidado, no bebas mucho o terminaras ebrio!");
  return 1;
}
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if(newkeys == KEY_FIRE && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_BEER)
  {
    if(Botella[playerid] >= 7) // con esto checkeamos la cuenta del jugador (si es igual o mayor a 7)
    {
      SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
      SendClientMessage(playerid, COLOR, "Se te ha acabado tu botella!");
    }
    else return Botella[playerid] ++; // si no ha llegado a los 7, se agrega uno
  }
  return 1;
}
Si no fuera asi, entonces todos los jugadores sumaran puntos a la unica variable Botella, 7 a la misma vez haciendolo causarнa que la botella se acabara de una vez...
Reply


Messages In This Thread
[AYUDA] Limitar uso del boton a 7 - by pooooolo - 09.01.2010, 15:15
Re: [AYUDA] Limitar uso del boton a 7 - by TheChaoz - 09.01.2010, 19:14
Re: [AYUDA] Limitar uso del boton a 7 - by pooooolo - 09.01.2010, 22:00
Re: [AYUDA] Limitar uso del boton a 7 - by Miguel - 10.01.2010, 00:00

Forum Jump:


Users browsing this thread: 1 Guest(s)