How can i make an /accent cmd that the player type /accent and any thing he want like /accent English
This is from my gamemode. You can't choose Accents in strings, but only numbers.
pawn Код:
CMD:accent(playerid,params[])
{
new accent;
if(sscanf(params,"i",accent))
{
SendClientMessage(playerid,COLOR_GREY,"USAGE: /accent [number]");
SendClientMessage(playerid,COLOR_GREY,"1:[American] 2:[Mexican] 3:[Russian]");
return 1;
}
if(accent > 3 || accent < 1)
{
SendClientMessage(playerid,COLOR_GREY,"Invalid number.");
return 1;
}
else
{
pInfo[playerid][pAccent] = accent;
if(accent == 1) return SendClientMessage(playerid,COLOR_WHITE,"You have switched to an American accent.");
else if(accent == 2) return SendClientMessage(playerid,COLOR_WHITE,"You have switched to a Mexican accent.");
else if(accent == 3) return SendClientMessage(playerid,COLOR_WHITE,"You have switched to a Russian accent.");
return 1;
}
}