SA-MP Forums Archive
ZCMD & MySQL - 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: ZCMD & MySQL (/showthread.php?tid=155146)



ZCMD & MySQL - Antonio [G-RP] - 17.06.2010

My friend and I are going to start a script from scratch, roleplay of course.

He knows ZCMD, but I don't is there any topics that will indepth explain ZCMD and sscanf to me?

Also, any topics for him to learn MySQL? Thanks.


Re: ZCMD & MySQL - (SF)Noobanatior - 17.06.2010

sscanf = https://sampwiki.blast.hk/wiki/Sscanf
dcmd = https://sampwiki.blast.hk/wiki/Dcmd


Re: ZCMD & MySQL - Miguel - 17.06.2010

Quote:
Originally Posted by ♂ Antonio_
...roleplay of course.
aren't there more COOL modes?

Anyways, check the MySQL topic, there's a link for a sample script.

ZCMD == as simple as this:
pawn Код:
// out of any function or whatever
CMD:commandname(playerid, params[])
{
  return 1;
}
pawn Код:
CMD:whatdiditype(playerid, params[])
{
  new
    string[128];
   
  format(string, sizeof(string), "You typed: %s", params);
  SendClientMessage(playerid, COLOR, string);
  return 1;
}
// that will send a message to you with what you typed after the command.
pawn Код:
CMD:isitright(playerid, params[])
{
  new
    id,
    myname[24],
    name[24];

  if(sscanf(params, "rs[23]", id, name)) SendClientMessage(playerid, COLOR, "Type /isitright YOURID YOURNAME!"), SendClientMessage(playerid, COLOR, "E.G /isitright 135 Ronald");
  else if(id != playerid) SendClientMessage(playerid, RED, "That isn't your ID!");
  GetPlayerName(playerid, myname, 24);
  else if(strcmp(name, myname, false) == 1) SendClientMessage(playerid, RED, "That isn't your name!");
  else
  {
    new string[128];
    format(string, 128, "Congratulations, you typed /isitright %s!", params);
    SendClientMessage(playerid, COLOR, string);
  }
  return 1;
}