whats wrong here?
#1

http://pastebin.com/m4935cada

everytime i use the command it just says (i do have the timer code, its just not there)



SERVER: Unknown Command
Reply
#2

Your going to have to show whole OnPlayerCommandText. That small snippet doesn't work.
Reply
#3

here
http://pastebin.com/m65398536
Reply
#4

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  new cmd[300], idx;
    cmd = strtok(cmdtext, idx);
    dcmd(givecash, 8, cmdtext);

//jail
    if(strcmp(cmdtext, "/ar", true) == 0)
    {
    new sendername[MAX_PLAYER_NAME];
    new giveplayerid;
    new giveplayer[MAX_PLAYER_NAME];
    new string[256], tmp[256];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ar [id]");
    giveplayerid = strval(tmp);
    new myskin = GetPlayerSkin(playerid);
  if(myskin == 280)
  {
    if(IsPlayerConnected(giveplayerid))
    {
      GetPlayerName(playerid, sendername, sizeof(sendername));
      GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
      format(string, sizeof(string), "Officer %s(%i) Has jailed you for 2 minutes!", sendername, playerid);
      SendClientMessage(giveplayerid, COLOR_YELLOW, string);
      SetPlayerInterior(giveplayerid,3);
      SetPlayerPos(giveplayerid,198.3797,160.8905,1003.0300);
      SetPlayerFacingAngle(giveplayerid,177.0350);
      GameTextForPlayer(playerid,"~r~Don't fight in Jail!",2500,3);
      SetCameraBehindPlayer(giveplayerid);
      SetTimer("ExitJail",120000,0);
            format(string, sizeof(string), "You have jailed %s(%i)", giveplayer, giveplayerid);
      SendClientMessage(playerid, COLOR_YELLOW, string);
      GivePlayerMoney( playerid, 10000 );
    }
    else
    {
      format(string, sizeof(string), "SERVER: %d isn't connected", giveplayerid);
      SendClientMessage(playerid, COLOR_WHITE, string);
    }
  }
  else return SendClientMessage(playerid, COLOR_RED, "[!] You must be a cop!");
  return 1;
    }




return 0;//There has to be a return 0 before the end of your OnPlayerCommandText :)
}
Reply
#5

still doesnt work
Reply
#6

Change
Код:
if(strcmp(cmdtext, "/ar", true) == 0)
{
For
Код:
if(strcmp(cmdtext, "/ar", true, 3) == 0)
{
Reply
#7

Quote:
Originally Posted by Delused
Change
Код:
if(strcmp(cmdtext, "/ar", true) == 0)
{
For
Код:
if(strcmp(cmdtext, "/ar", true, 3) == 0)
{
its fine how it is
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)