#include <a_samp>
new MoneyJail[MAX_PLAYERS];
new BerakTimer;
#define sarga 0xFFFF00AA
#define red 0xE50000AA
forward Berak(playerid);
public OnFilterScriptInit()
{
BerakTimer = SetTimer(\"Berak\", 200, 1);
return 1;
}
public OnFilterScriptExit()
{
KillTimer(BerakTimer);
return 1;
}
public Berak(playerid)
{
if(GetPlayerMoney(playerid) < 0)
{
new string[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
SetPlayerPos(playerid,197.6661,173.8179,1003.0234);
SetPlayerInterior(playerid,3);
MoneyJail[playerid] = 1;
format(string, sizeof(string), \"%s börtönbe lett zárva a kevés pénze miatt!\", pName);
SendClientMessageToAll(sarga, string);
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, \"/tele\", true) == 0)
{
if(MoneyJail[playerid] == 1)
{
SendClientMessage(playerid, red, \"Nem használhatod, mert börtönben vagy!!!\");
}
else if(MoneyJail[playerid] == 0)
{
//ide a cuccok xD ami teleportnál van
}
return 1;
}
return 0;
}
de ezt csak akkor, ha azt akarod, h ne tudjon kimenni, ha 0 alatt van a pénze