16.08.2011, 21:35
es un cmd con un parametro, no es dificil de hacer.
el codigo se puede optimizar pero no te quiero marear mucho, cualquier cosa avisa
pawn Код:
//strcmp:
if(!strcmp(cmdtext, "/CambiarcolordeNick", true, 19){
if(!strlen(cmdtext[20]))return SendClientMessage(playerid, color, "Uso: /CambiarcolordeNick <color>");
if(!strcmp(cmdtext[20], "azul", true)){
SetPlayerColor(playerid, 0x0000FFFF);
return SendClientMessage(playerid, color, "Tu nick ahora es azul!!");
}
else if(!strcmp(cmdtext[20], "rojo", true)){
SetPlayerColor(playerid, 0xFF0000FF);
return SendClientMessage(playerid, color, "Tu nick ahora es rojo!!");
}
else if(!strcmp(cmdtext[20], "verde", true)){
SetPlayerColor(playerid, 0x00FF00FF);
return SendClientMessage(playerid, color, "Tu nick ahora es verde!!");
}return SendClientMessage(playerid, color, "Ese color no existe");
}
//zcmd
CMD:cambiarcolordelnick(playerid, params[])
{
if(IsNull(params))return SendClientMessage(playerid, color, "Uso: /CambiarcolordeNick <color>");
if(!strcmp(params, "azul", true)){
SetPlayerColor(playerid, 0x0000FFFF);
return SendClientMessage(playerid, color, "Tu nick ahora es azul!!");
}
else if(!strcmp(params, "rojo", true)){
SetPlayerColor(playerid, 0xFF0000FF);
return SendClientMessage(playerid, color, "Tu nick ahora es rojo!!");
}
else if(!strcmp(params, "verde", true)){
SetPlayerColor(playerid, 0x00FF00FF);
return SendClientMessage(playerid, color, "Tu nick ahora es verde!!");
}return SendClientMessage(playerid, color, "Ese color no existe");
}