Hello guys, how can I make this cmd to like, cases? like /bandana [1-9] i've an attachedobject system, so I wanna like know to make this?
Doesnt give me any errors / warnings, compiles fine, but IG it aren't appearing, it aren't sayin "Unknown Command" just some blank sht, please help e.
that is a really bad way to get any data from your command. Use a plugin called
.
Ok, the command shows up IG now, but it doesnt work at all, when im doing /gsign 1
Код HTML:
CMD:gsign(playerid, params[])
{
if(isnull(params) == 0) return SendClientMessage(playerid,-1,"/gsign [1-20]");
if(params[0] == 1) ApplyAnimation(playerid, "GHANDS", "gsign1", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 2) ApplyAnimation(playerid, "GHANDS", "gsign1LH", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 3) ApplyAnimation(playerid, "GHANDS", "gsign2", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 4) ApplyAnimation(playerid, "GHANDS", "gsign2LH", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 5) ApplyAnimation(playerid, "GHANDS", "gsign3", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 6) ApplyAnimation(playerid, "GHANDS", "gsign3LH", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 7) ApplyAnimation(playerid, "GHANDS", "gsign4", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 8) ApplyAnimation(playerid, "GHANDS", "gsign4LH", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 9) ApplyAnimation(playerid, "GHANDS", "gsign5", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 10) ApplyAnimation(playerid, "GHANDS", "gsign5LH", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 11) ApplyAnimation(playerid, "GHANDS", "LHGsign1", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 12) ApplyAnimation(playerid, "GHANDS", "LHGsign2", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 13) ApplyAnimation(playerid, "GHANDS", "LHGsign3", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 14) ApplyAnimation(playerid, "GHANDS", "LHGsign4", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 15) ApplyAnimation(playerid, "GHANDS", "LHGsign5", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 16) ApplyAnimation(playerid, "GHANDS", "RHGsign1", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 17) ApplyAnimation(playerid, "GHANDS", "RHGsign2", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 18) ApplyAnimation(playerid, "GHANDS", "RHGsign3", 4.1, 0, 1, 1, 1, 0, 1);
if(params[0] == 19) ApplyAnimation(playerid, "GHANDS", "RHGsign4", 4.1, 0, 1, 1, 1, 1, 1);
if(params[0] == 20) ApplyAnimation(playerid, "GHANDS", "RHGsign5", 4.1, 0, 1, 1, 1, 1, 1);
return 1;
}
Like I said, use sscanf and switch after it.
You are doing this. You enter 1 as a parameter, and it is written as a character, not a number. You would need to set if(params[0] == "1") for each if branching.