Ich wollte es so machen, das wenn er 13x Drogen genommen hat, soll er keine mehr nehmen können aber es haut i.wie nicht hin, ich kann weiter hin Drogen nehmen.
if(strcmp("/usedrugs", cmd, true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pDrugs] >= 2)
{
new Float:Health,bekifft[MAX_PLAYERS];
if(bekifft[playerid] == 1) return SendClientMessage(playerid,COLOR_ERRORTEXT," Du bist bekifft! Du kannst keine weiteren Drogen nehmen!");
if(drugtime[playerid] > gettime())return SendClientMessage(playerid,COLOR_ERRORTEXT," Du kannst nur jede 20 Sekunden Drogen nehmen!");
drugtime[playerid] = gettime()+20;
GetPlayerName(playerid,sendername,sizeof(sendername));
GetPlayerHealth(playerid, Health);
PlayerStoned[playerid] += 1;
if(PlayerStoned[playerid] >= 2)
{
GameTextForPlayer(playerid, "~w~Du bist~n~~p~bekifft", 4000, 1);
bekifft[playerid] = 1;
}
/*if(PlayerStonedTime[playerid] > 0)
{
GameTextForPlayer(playerid, "~w~Du bist~n~~p~bekifft", 4000, 1);
//SetPlayerDrunkLevel(playerid,GetPlayerDrunkLevel(playerid) +3000);
}*/
if(PlayerInfo[playerid][pDrugPerk] > 0)
{
new hp = 5 * PlayerInfo[playerid][pDrugPerk];
SetPlayerHealth(playerid, Health + hp);
}
else
{
SetPlayerHealth(playerid, Health + 4);
}
PlayerInfo[playerid][pDrugs] -= 2;
OnePlayAnim(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0); // Eat Burger
format(string, sizeof(string), "* %s pfeift sich 2 Gramm getrocknetes Gras rein.", sendername);
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(string,sizeof(string),"* %s nutzt usedrugs", sendername);
EnterToLog("usedrugs",string);
}
else
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Du hast keine Drogen !");
}
}
return 1;
}