Noch was, habe eine Funktion womit der Spieler nur alle 5 Sekunden ein Getränk trinken kann, doch nach einmaligen trinken erscheint immer die Errormeldung, egal wie lange man wartet.
new Waitingtime[MAX_PLAYERS];
#define WaitingtimeInterval 5000
OnPlayerKeyStateChange Teil
else if(IsPlayerInRangeOfPoint(playerid, 0.2,1411.1259,-1484.6494,106.6032) )//Sprunk Machine
{
{
if (gettime() <Waitingtime[playerid])
return SendClientMessage(playerid,0xFFFF0000, "Please wait.");
Waitingtime[playerid] = gettime() + WaitingtimeInterval;
}
if(GetPlayerMoney(playerid) <1) // 1 $ required.
{
// Won't heal the player unless he got at least 1 $.
}
else
{
ApplyAnimation(playerid,"VENDING","VEND_Use",4.1,0,0,0,0,0);
PlayerPlaySound(playerid,42600,0,0,0);
GivePlayerMoney(playerid,-1);
new Float:health;
GetPlayerHealth(playerid,health);
health += 33.3;
if(health > 100.0) health = 100.0;
SetPlayerHealth(playerid,health);
}
}
}
Woran liegts?