SA-MP Forums Archive
Commands interfering. - 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: Commands interfering. (/showthread.php?tid=151939)



Commands interfering. - IcyBlight - 01.06.2010

Could someone explain to me why /cellout uses /cellin? Or why /fix calls the /fix command, but also goes "Faction: x" - I realize it's because the commands are interfering, but this is pissing me off. Halp plz!

pawn Код:
if(!strcmp(cmdtext, "/cellin", true, 7))
    {
      if(TakingTut[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are viewing the tutorial. You cannot use this command now.");
      if(!IsPlayerInAnyVehicle(playerid))
      {
        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
        return 1;
        }
    }
    if(!strcmp(cmdtext, "/cellout", true, 8))
    {
      if(TakingTut[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are viewing the tutorial. You cannot use this command now.");
      if(!IsPlayerInAnyVehicle(playerid))
      {
        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
        return 1;
        }
    }



Re: Commands interfering. - DJDhan - 01.06.2010

Pff Use this:
Код:
if(!strcmp(cmdtext, "/cellin", true, 7)==0)
{
  if(TakingTut[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are viewing the tutorial. You cannot use this command now.");
  if(!IsPlayerInAnyVehicle(playerid))
  {
  SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
  }
  return 1;
}
if(!strcmp(cmdtext, "/cellout", true, 8)==0)
{
  if(TakingTut[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are viewing the tutorial. You cannot use this command now.");
  if(!IsPlayerInAnyVehicle(playerid))
  {
  SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
  }
  return 1;
}



Re: Commands interfering. - IcyBlight - 01.06.2010

See, I knew it would be some stupid simple shit that anyone should know, that I just don't.

Thanks


Re: Commands interfering. - IcyBlight - 01.06.2010

Quote:
Originally Posted by DJDhan
Pff Use this:
Код:
if(!strcmp(cmdtext, "/cellin", true, 7)==0)
{
  if(TakingTut[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are viewing the tutorial. You cannot use this command now.");
  if(!IsPlayerInAnyVehicle(playerid))
  {
  SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
  }
  return 1;
}
if(!strcmp(cmdtext, "/cellout", true, 8)==0)
{
  if(TakingTut[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are viewing the tutorial. You cannot use this command now.");
  if(!IsPlayerInAnyVehicle(playerid))
  {
  SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
  }
  return 1;
}
That shit gave me phat tag mismatches. Someone who knows what they're talking about, help please? Sorry bout the double post.


Re: Commands interfering. - Antonio [G-RP] - 01.06.2010

What line did tag mismatch come on?


Re: Commands interfering. - IcyBlight - 01.06.2010

All of the lines with the /'something' command, when I added == 0 to them, like the other guy showed.

I think he messed his code up.

Anyway, another problem,

'/ann Hey' = "Announcement: Hey"

however,

'/annxxxx' = "Announcement: xxx"

Anyone got a fix for this? I assume it's the same solution as to my other problems.


Re: Commands interfering. - IcyBlight - 02.06.2010

12-hour bump.


Re: Commands interfering. - IcyBlight - 03.06.2010

Quote:
Originally Posted by IcyBlight
12-hour bump.