set player color
#6

please indent code, this is making it hard to read


Код:
public OnPlayerCommamdText(playerid, cmdtext[])
{
   if (strcmp(cmdtext,"/color",true) == 0)
   {
     // these two lines would do the same as strtok, you can use that if you prefer it!
     new params[128];
     strmid(params, cmdtext, strfind(cmdtext, " ", true), strlen(params)); 

     if (!strlen(params))
        return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /color [color]");

     if (strcmp(params, "yellow", true) == 0)
        SetPlayerColor(playerid, COLOR_YELLOW);
     else if (strcmp(params, "green", true) == 0)
        SetPlayerColor(playerid, COLOR_GREEN);
     else if (strcmp(params, "red", true) == 0)
        SetPlayerColor(playerid, COLOR_RED);
     else
        SendClientMessage(playerid, COLOR_YELLOW, "What color is that? There's only yellow, green and red in this example");

     return 1;
   }
}
Reply


Messages In This Thread
set player color - by My_Waffles_Bitch_L0L - 12.02.2009, 06:30
Re: set player color - by [RP]Rav - 12.02.2009, 06:35
Re: set player color - by My_Waffles_Bitch_L0L - 12.02.2009, 07:14
Re: set player color - by [RP]Rav - 12.02.2009, 07:22
Re: set player color - by My_Waffles_Bitch_L0L - 12.02.2009, 07:34
Re: set player color - by [RP]Rav - 12.02.2009, 07:42
Re: set player color - by My_Waffles_Bitch_L0L - 12.02.2009, 07:55
Re: set player color - by [RP]Rav - 12.02.2009, 07:57
Re: set player color - by My_Waffles_Bitch_L0L - 12.02.2009, 07:59

Forum Jump:


Users browsing this thread: 1 Guest(s)