Command without " / "
#8

Quote:
Originally Posted by cynic
Посмотреть сообщение
pawn Код:
if(text[0]=='&')
{
      OnPlayerCommandText(playerid, "/example");
      return 0;
}
This wouldnt work... - OnPlayerCommand is a "public" but publics cannot be run in other publics, Only functions can.

This would work, however

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '&')
    {
        new pName[MAX_PLAYER_NAME], string[64];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "%s: lol", pName); //You could use SAMP 0.3c's colour embedding to make it look better
        SendClientMessage(playerid, COLOUR, string);
    }
    return 1;
}
Reply


Messages In This Thread
Command without " / " - by blackwave - 13.12.2010, 17:35
Re: Command without " / " - by DRIFT_HUNTER - 13.12.2010, 17:43
Re: Command without " / " - by JaTochNietDan - 13.12.2010, 17:57
Re: Command without " / " - by blackwave - 13.12.2010, 18:03
AW: Command without " / " - by Cank - 13.12.2010, 18:32
Re: Command without " / " - by Ash. - 13.12.2010, 18:38
Re: AW: Command without " / " - by CyNiC - 13.12.2010, 18:40
Re: AW: Command without " / " - by Ash. - 13.12.2010, 18:45

Forum Jump:


Users browsing this thread: 1 Guest(s)