Hello system(need real help)
#4

Im not sure this will work, you should have the stock strtok sumwhere unless ur a noob :P
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  new cmd[128], idx;
  cmd = strtok(cmdtext, idx);

  if(strcmp("/hello", cmd, true)==0)
  {
    new tmp[128]; tmp = strtok(cmdtext, idx);
    if(strlen(tmp))//If the player used params
    {
    new pName[MAX_PLAYER_NAME], iName[MAX_PLAYER_NAME];
    new string[128];
    GetPlayerName(playerid, pName, sizeof(pName));
    GetPlayerName(strval(tmp), iName, sizeof(iName));
    format(string, sizeof(string), "%s says hello to %s!", pName, iName);
    SendClientMessageToAll(color, string);//Change color
    }
    else if(!strlen(tmp))//If the player didnt use params
    {
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), "%s says hello to all!", pName);
    SendClientMessageToAll(color, string);//Change color
    }
    return 1;
  }
  return 0;
}
Reply


Messages In This Thread
Hello system(need real help) - by Nexotronix - 02.03.2010, 16:06
Re: Hello system(need real help) - by VonLeeuwen - 02.03.2010, 16:23
Re: Hello system(need real help) - by Nexotronix - 02.03.2010, 16:34
Re: Hello system(need real help) - by bajskorv123 - 02.03.2010, 17:19
Re: Hello system(need real help) - by Nexotronix - 03.03.2010, 12:13

Forum Jump:


Users browsing this thread: 1 Guest(s)