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...