01.12.2011, 09:36
i was making my new command today i decide to make /setcolor <0 to 10 or randomcolor>
but i have problem with random color yeah it work in the first time when i type in the second
time it do not work anymore it still remain in color i need help guys
can some one help me about this?
code
i hope you solve it
but i have problem with random color yeah it work in the first time when i type in the second
time it do not work anymore it still remain in color i need help guys
can some one help me about this?
code
pawn Код:
CMD:setcolor(playerid, params[])
{
new string[128],color = random(12);
color = GetPlayerColor(playerid);
if(isnull(params))
{
SendClientMessage(playerid, COLOR_RED,"USAGE: /setcolor <0 - 10>");
SendClientMessage(playerid, COLOR_WHITE,"if you do not want color ids type "green"randomcolor "white"it will pick you a random color");
}
if(!strcmp(params, "0", true))
{
SetPlayerColor(playerid, COLOR_BLACK);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Black");
return 1;
}
if(!strcmp(params, "1", true))
{
SetPlayerColor(playerid, COLOR_WHITE);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"White");
return 1;
}
if(!strcmp(params, "2", true))
{
SetPlayerColor(playerid, COLOR_GREY);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Grey");
return 1;
}
if(!strcmp(params, "3", true))
{
SetPlayerColor(playerid, COLOR_ORANGE);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Orange");
return 1;
}
if(!strcmp(params, "4", true))
{
SetPlayerColor(playerid, COLOR_YELLOW);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Yellow");
return 1;
}
if(!strcmp(params, "5", true))
{
SetPlayerColor(playerid, COLOR_RED);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Red");
return 1;
}
if(!strcmp(params, "6", true))
{
SetPlayerColor(playerid, COLOR_GREEN);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Green");
return 1;
}
if(!strcmp(params, "7", true))
{
SetPlayerColor(playerid, COLOR_BLUE);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Blue");
return 1;
}
if(!strcmp(params, "8", true))
{
SetPlayerColor(playerid, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Purple");
return 1;
}
if(!strcmp(params, "9", true))
{
SetPlayerColor(playerid, COLOR_PINK);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Pink");
return 1;
}
if(!strcmp(params, "10", true))
{
SetPlayerColor(playerid, COLOR_VIOLET);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Violet");
return 1;
}
if(!strcmp(params, "randomcolor", true))
{
switch(color)
{
case 0: SetPlayerColor(playerid, COLOR_LIGHTBLUE);
case 1: SetPlayerColor(playerid, COLOR_LIGHTGREEN);
case 2: SetPlayerColor(playerid, COLOR_CYAN);
case 3: SetPlayerColor(playerid, COLOR_LIME);
case 4: SetPlayerColor(playerid, COLOR_BLUEGREEN);
case 5: SetPlayerColor(playerid, COLOR_BRIGHTRED);
case 6: SetPlayerColor(playerid, COLOR_GREENISHGOLD);
case 7: SetPlayerColor(playerid, COLOR_SEAGREEN);
case 8: SetPlayerColor(playerid, COLOR_VIOLET);
case 9: SetPlayerColor(playerid, COLOR_BROWN);
case 10: SetPlayerColor(playerid, COLOR_LIGHTCYAN);
case 11: SetPlayerColor(playerid, COLOR_LEMON);
}
format(string,sizeof(string),"You change your color name to "yellow"%s",color);
SendClientMessage(playerid,COLOR_GREEN,string);
return 1;
}
return 1;
}
![Cheesy](images/smilies/biggrin.png)