PDA

View Full Version : Command, need a little help


UnknownGamer
05/10/2012, 02:02 AM
else if(strlen(tmp) == "165")


How do I do this, so if they type "/clothes 165" - They get an error message, they cannot use skin 165.

Cheers.

Passout
05/10/2012, 02:16 AM
else if(strlen(tmp) == "165")
{
SendClientMessage(playerid,//UR COLOR//,"You cannot use this ID!");
return 1;
}



?? Im not really familiar with that(strlen(tmp) == "165")...Im not sure exactly what you are asking

Wish I could help you properly though ;p

Lordzy
05/10/2012, 02:18 AM
You mean like this?

CMD:skin(playerid,params[])
{
new skinid;
if(sscanf(params,"i",skinid)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /skin [skin id]");
if(skinid < 0 || skinid > 299) return SendClientMessage(playerid, 0xFF0000, "Invalid skin id");
if(skinid == 165) return SendClientMessage(playerid, 0xFF0000FF, "You cannot use this skin"); //Here, it checks whether the skinid choosen is 165 or not.

hotspicytaco
05/10/2012, 02:30 AM
CMD:Clothes(playerid,params[])
{
if(!strlen(params)) return SendClientMessage(playerid,-1,"[USAGE] /Clothes [id]");
if(strlen(params) == 165) return SendClientMessage(playerid,0xFF0000FF,"[ERROR] You can't use these clothes!");
//Something else
return 1;
}