Hey, ich wollte es so machen, das wenn man mehr als 12x Drogen genommen hat, soll man für 30Sekunden bekifft auf den Boden liegen doch ich weiß nicht genau wie es gehen soll bzw. klappt nicht :o
if(strcmp("/usedrugs", cmd, true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pDrugs] >= 2)
{
new Float:Health;
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] >= 12)
{
PlayerStonedTime[playerid] = 4;
}
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;