SA-MP Forums Archive
whats wrong here? - 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: whats wrong here? (/showthread.php?tid=69567)



whats wrong here? - CJ101 - 19.03.2009

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


Re: whats wrong here? - Pixels^ - 19.03.2009

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


Re: whats wrong here? - CJ101 - 19.03.2009

here
http://pastebin.com/m65398536


Re: whats wrong here? - [HiC]TheKiller - 19.03.2009

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 :)
}



Re: whats wrong here? - CJ101 - 19.03.2009

still doesnt work


Re: whats wrong here? - Delused - 19.03.2009

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



Re: whats wrong here? - Kinetic - 19.03.2009

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