18.04.2009, 21:17
please help, i have a jail system, if your in dept at bank time, you go to jail for 3mins
how do i stop all cmds?
how do i stop all cmds?
public OnPlayerCommandText(playerid, cmdtext[])
{
if(IsInJail(playerid)) // Variable here.
return 1;
// Your commands here
return 0;
}
Originally Posted by [SAP
Francis ]
Hi there, To make that, you must return a true value when you're in jail, like that: pawn Код:
Kind regards, Francis Morissette SA-MP Scripter http://sa-mp.com |
Originally Posted by aspire5630
Quote:
|
Originally Posted by [SAP
Francis ]
Quote:
When jailing the player, you should set a variable like "Jailed[playerid]" to true or to 1, as 1 is the numerical value of true. Then you would replace "IsInJail(playerid)" by "Jailed[playerid]". Have fun scripting. Kind regards, Francis Morissette SA-MP Scripter http://sa-mp.com |
new IsJailed[MAX_PLAYERS];
IsJailed[giveplayerid] = 1;
IsJailed[giveplayerid] = 0;
if(IsJailed[playerid] == 1) { return 1; }
Originally Posted by NeRoSiS
This at the top
Код:
new IsJailed[MAX_PLAYERS]; Код:
IsJailed[giveplayerid] = 1; Код:
IsJailed[giveplayerid] = 0; Код:
if(IsJailed[playerid] == 1) { return 1; } |
new Jailed[MAX_PLAYERS]; public OnPlayerSpawn(playerid) { if(Jailed[playerid] == 1) { SetPlayerPos(playerid, ...); // Enter your jail co ords here } return 1; } public Timer(playerid) { SendClientMessageToAll(COLOR_YELLOW, "Please Visit us here at, Kontrol-Gaming.co.cc"); // Color can be edited, Look at top for the colors. SendClientMessageToAll(COLOR_YELLOW, " Please remember to report any bugs you may find, /Bug <Message>"); for(new a=0; a<MAX_PLAYERS; a++) { if(GetPlayerMoney(a) < 0) { SetPlayerPos(playerid, ...); // Enter you jail co ords here Jailed[a] = 1; SetTimerEx("UnJailTimer", 80000, 0, "d", a); // I think 80000 milliseconds is 3 mins, Correct it if its wrong } GivePlayerMoney(a, 1000); } SendClientMessageToAll(COLOR_LIGHTGREEN, "You've recieved playing money **$1000**!"); } public UnJailTimer(playerid) { Jailed[playerid] = 0; return 1; }
Originally Posted by NeRoSiS
This at the top
Код:
new IsJailed[MAX_PLAYERS]; Код:
IsJailed[giveplayerid] = 1; Код:
IsJailed[giveplayerid] = 0; Код:
if(IsJailed[playerid] == 1) { return 1; } |