One thing, someone help.
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  new command[32],params[96];
  if (strfind(cmdtext, " ", false) != -1)
  {
    strmid(command, cmdtext, 0, strfind(cmdtext, " ", false));
    strmid(params, cmdtext, strfind(cmdtext, " ", false), strlen(cmdtext));
  }
  if (strcmp(command, "//", true) == 0)
  {
    new AdminName[MAX_PLAYER_NAME], AdminText[128];
    GetPlayerName(playerid,AdminName,sizeof(AdminName));
    format(AdminText,sizeof(AdminText),"%s: %s",AdminName,params);
    SendClientMessageToAdmins(0xA954FFFF,AdminText);
    return 1;
  }
  return 0;
}
Here you go mate. The first "if" finds the space between the command and the parameters (/command parameters). The second if is your command ( // [text] ). What this does is send everything the player types after //[space] to the admins.

Just add everything in your OnPlayerCommandText(playerid, cmdtext[]) and it should work.
Reply


Messages In This Thread
One thing, someone help. - by Dreftas - 25.06.2009, 19:17
Re: One thing, someone help. - by bigcomfycouch - 25.06.2009, 19:24
Re: One thing, someone help. - by Cezar - 25.06.2009, 19:30
Re: One thing, someone help. - by Dreftas - 25.06.2009, 19:37

Forum Jump:


Users browsing this thread: 2 Guest(s)