How to make a jail command -
aspire5630 - 29.04.2009
would it be
Код:
if (strcmp("/Jail", cmdtext, true, 10) == 0)
{
IsPlayerAdmin(playerid); // Not botherd atm, if player is or is not admin ;P
SetPlayerPos(playerid, CO-ORDS
return 1;
then make a timer for the injail?
Re: How to make a jail command -
OmeRinG - 29.04.2009
I really don't get why people use strcmp like that, just do:
if (!strcmp("/Jail", cmdtext, true))
And yes it works like that, with strtok for playerid AND time.
but you also need a global variable:
new IsJailed[MAX_PLAYERS];
so if you want to block certain things you do:
if(IsJailed[playerid]) return SendClientMessage(playerid,COLOR_RED,"You cannot blablabla when in jail.");
and when you jail the player:
IsJailed[playerid = 1;
when you unjail same thing with 0
Re: How to make a jail command -
Donny_k - 29.04.2009
pawn Код:
("/Jail", cmdtext, true, 10)
"/jail" is five not ten characters.
Re: How to make a jail command -
aspire5630 - 29.04.2009
Quote:
Originally Posted by OmeRinG
I really don't get why people use strcmp like that, just do:
if (!strcmp("/Jail", cmdtext, true))
And yes it works like that, with strtok for playerid AND time.
but you also need a global variable:
new IsJailed[MAX_PLAYERS];
so if you want to block certain things you do:
if(IsJailed[playerid]) return SendClientMessage(playerid,COLOR_RED,"You cannot blablabla when in jail.");
and when you jail the player:
IsJailed[playerid = 1;
when you unjail same thing with 0
|
Ok it works

Thanks
But how do i make it soo.
i can jail a person like this
/jail [id]
Re: How to make a jail command -
aspire5630 - 29.04.2009
Anyone know?
Sorry for double post
Re: How to make a jail command -
Weirdosport - 29.04.2009
Quote:
Originally Posted by OmeRinG
I really don't get why people use strcmp like that, just do:
if (!strcmp("/Jail", cmdtext, true))
|
Because it's the default in new.pwn =(
Re: How to make a jail command -
yom - 30.04.2009
Quote:
Originally Posted by aspire5630
Anyone know?
Sorry for double post
|
I think there are enough (hundred of) examples on this forum..
Re: How to make a jail command -
aspire5630 - 30.04.2009
Quote:
Originally Posted by 0rb
Quote:
Originally Posted by aspire5630
Anyone know?
Sorry for double post
|
I think there are enough (hundred of) examples on this forum..
|
Yes i have looked but they all seem to be from the GF
and i dont want from GF

because i have tryed and it doesent work, i get errors
Re: How to make a jail command -
aspire5630 - 30.04.2009
Once again, sorry for double post
but i need a script badly, anyone help?
Re: How to make a jail command -
aspire5630 - 30.04.2009
** Bump, i have tryed GF
and i couldt get it to work, to many errors :P