I need help with the Jail cmd - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I need help with the Jail cmd (
/showthread.php?tid=173966)
[Help]I need help with the Jail cmd -
zack3021 - 04.09.2010
It works fine but when i change the coords, it places me back into the coords for the first cmd. BTW who ever made it, thanks alot.
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/jail",cmdtext, true, 5))
{
if(!strlen(cmdtext[6]))
{
SendClientMessage(playerid, 0xFF0000FF, "Usage: /jail [playerid]");
return 1;
}
new ID = strval(cmdtext[6]);
new strv[170];
if(IsPlayerConnected(ID))
{
format(strv, 170, "~ You have been jailed");
SendClientMessage(ID,0xFF8000FF, strv);
SetPlayerPos(ID, 2756.1255,676.9288,10.8984);
}
return 1;
}
//----------second jail cmd----------
if(!strcmp("/jail1",cmdtext, true, 6))
{
if(!strlen(cmdtext[6]))
{
SendClientMessage(playerid, 0xFF0000FF, "Usage: /jail [playerid]");
return 1;
}
new ID = strval(cmdtext[6]);
new strv[170];
if(IsPlayerConnected(ID))
{
format(strv, 170, "~ You have been jailed");
SendClientMessage(ID,0xFF8000FF, strv);
SetPlayerPos(ID, 2755.4023,683.8808,10.8984);
}
return 1;
}
return 0;
}
Re: I need help with the Jail cmd -
DarkPower - 04.09.2010
Use ZCMD and sscanf its faster and away better than strtok and strcmp
Re: I need help with the Jail cmd -
zack3021 - 04.09.2010
Thanks but can i have a ZCMD command for jail or just a Tut how to make one. I know, but i searched the forums all night and can't seem to find one
Re: I need help with the Jail cmd -
zack3021 - 04.09.2010
Anyone plz help me.
Re: I need help with the Jail cmd -
Toni - 04.09.2010
Here, I made one for you, with sscanf and ZCMD.
pawn Код:
CMD:jail(playerid, params[])
{
new
id,
str[128]
;
if(sscanf(params, "u", id)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /jail <playerid/name>");
format(str, sizeof(str), "You have jailed %d!", id);
SendClientMessage(playerid, 0xFF0000FF, str);
format(str, sizeof(str), "You been jailed by %s!", playerid);
SendClientMessage(id, 0xFF0000FF, str);
SetPlayerPos(id, 2755.40, 683.88, 10.89); //This is the coords from your /jail1 cmd.
return 1;
}
Re: I need help with the Jail cmd -
zack3021 - 04.09.2010
I get error
Код:
C:\Program Files\Rockstar Games\GTA San Andreas\Pawno 0.3b\filterscripts\Untitled.pwn(50) : warning 203: symbol is never used: "ret_memcpy"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
And there is not line 49 and when i define it (new remcpy) it says it is already defined.
Re: I need help with the Jail cmd -
mrcoolballs - 04.09.2010
put this at the top of ur script:
pawn Код:
#pragma unused ret_memcpy
Re: I need help with the Jail cmd -
zack3021 - 04.09.2010
Thanks alot. it worked
But when i type it it says: UNKNOWN COMMAND
And it was loaded