SA-MP Forums Archive
strtok to dcmd? - 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: strtok to dcmd? (/showthread.php?tid=84116)



strtok to dcmd? - Rhemsis - 28.06.2009

I am trying to add a betting system to Yagu's Race Filterscript. He has written his commands in the dcmd format, which put simply, confuses me. I have written the command in my GM as strtok, hoping that it would identify when a player became a race participant through the filterscript....it did not.

So my question is, could somebody transpose this command below into dcmd format? Or am I asking a ridiculous question that makes absolutely no sense?

Or even, is there a way to link my gamemode and this filterscript through pawno?

pawn Код:
if(strcmp(cmd, "/racers", true) == 0) {
  if(IsSpawned[playerid] == 0) {
    SendClientMessage(playerid, COLOR_ERROR, "You are dead. You cannot use this command");
  return 1;
  }
  new raceresult =0;
  for(new i=0;i<MAX_PLAYERS;i++)
    {
    if(IsPlayerConnected(i) && RaceParticipant[i] >= 1)
    {
    raceresult ++;
    new raceename[30];
    GetPlayerName(i,raceename,30);
  format(string, sizeof(string), "%s(%d) is scheduled to race, use /betrace (id) (amt) to place a bet on this player",raceename,i,RaceParticipant[i]);
    SendClientMessage(playerid, 0x00C7FFAA, string);
    }
    }
  if(raceresult == 0) {
    SendClientMessage(playerid, 0x00C7FFAA, "There is no one signed up to race right now.");
    }
    return 1;
  }




Re: strtok to dcmd? - refshal - 28.06.2009

Why don't you just Compose the Filter Script with your Game Mode?


Re: strtok to dcmd? - Rhemsis - 28.06.2009

That was kind of my last resort, but the more I look at it the less hard it seems to be. I'll give it a shot, but if anyone else can still answer the above question it will be greatly appreciated.


Re: strtok to dcmd? - refshal - 28.06.2009

EDIT: Wait. I will Convert your Thing.