19.01.2011, 17:09
pawn Код:
COMMAND:gender(playerid,params[])
{
SetPVarString(playerid,"Gender",params);
new strz[38];
format(strz,sizeof(strz), "Your gender is now set to: %s.",params);
SendClientMessage(playerid, blue, strz);
return 1;
}
and if it doesn't then stops the command and sends a Invalid gender message.
Well heres how I would do it in java..
Код:
if(!params.equalsIgnoreCase("male") || params.equalsIgnoreCase("Female"))
Thanks for reading.
Bonus question :
Is 12 characters long enough for an Accent?
And should it be >= 14 because of the null characters on strings?
Код:
COMMAND:accent(playerid,params[]) { if(strlen(params) >= 13) { SendClientMessage(playerid, blue, "[LENGTH ERROR] Accent cannot be over 12 characters long."); return 1; } SetPVarString(playerid,"Accent",params); new strz[44]; format(strz,sizeof(strz), "Your accent is now set to: %s.",params); SendClientMessage(playerid, blue, strz); return 1; }