I need help with the Jail cmd
#1

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;
}
Reply
#2

Use ZCMD and sscanf its faster and away better than strtok and strcmp
Reply
#3

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
Reply
#4

Anyone plz help me.
Reply
#5

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;
}
Reply
#6

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.
Reply
#7

put this at the top of ur script:

pawn Код:
#pragma unused ret_memcpy
Reply
#8

Thanks alot. it worked

But when i type it it says: UNKNOWN COMMAND

And it was loaded
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)