#5

I have yet to understand why people insist on using that method of getting the single-stringed parameters of a player's command
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmd, "/ooc", true,4) == 0 || strcmp(cmd, "/o", true,2) == 0)
  {
    //if(IsPlayerConnected(playerid)) //Redundant, a player can't type a command if he isn't connected to the server
    if(gPlayerLogged[playerid] == 0)return SendClientMessage(playerid, COLOR_GREY, "  You havent logged in yet !");
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new space=strfind(cmdtext," ");
    if(!strlen(cmdtext[space])||(space==-1))return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/o)oc [ooc chat]");
    format(string, sizeof(string), "(( %s: %s ))", sendername, cmdtext[space]);
    printf("%s", cmdtext[space]);
    return 1;
  }
}
Reply


Messages In This Thread
/Ooc - by RoneyRemington - 23.02.2010, 18:43
Re: /Ooc - by Klutty - 23.02.2010, 18:47
Re: /Ooc - by Correlli - 23.02.2010, 18:50
Re: /Ooc - by RoneyRemington - 23.02.2010, 20:32
Re: /Ooc - by Joe Staff - 23.02.2010, 20:41
Re: /Ooc - by RoneyRemington - 23.02.2010, 23:00
Re: /Ooc - by Shubham - 24.02.2010, 10:29
Re: /Ooc - by RoneyRemington - 24.02.2010, 12:35
Re: /Ooc - by VonLeeuwen - 24.02.2010, 13:01

Forum Jump:


Users browsing this thread: 2 Guest(s)