23.07.2015, 18:24
Hey, I want to kick players who execute this command, but how do I make it so whenever they type /command 1 they'll be kicked from the server?
Code:
if(strcmp(cmdtext, "/Command", true) == 0)
{
//Random message
SendClientMessage(playerid, 0xFF0000FF, "Kicked");
SetTimerEx("DelayedKick", 1000, false, "i", playerid);
return 1;
}
It's hard to explain, but basically, if the player types /Command (ANYNUMBER FROM 1-1000) they will be kicked? Cause I don't wanna type this a 1000 times i.e like this:
if(strcmp(cmdtext, "/Command 1", true) == 0)
{
//Random message
SendClientMessage(playerid, 0xFF0000FF, "Kicked");
SetTimerEx("DelayedKick", 1000, false, "i", playerid);
return 1;
}
if(strcmp(cmdtext, "/Command 2", true) == 0)
{
//Random message
SendClientMessage(playerid, 0xFF0000FF, "Kicked");
SetTimerEx("DelayedKick", 1000, false, "i", playerid);
return 1;
}
And so on..I'm terrible at describing things...sorry.
Code:
if(strcmp(cmdtext, "/Command", true) == 0)
{
//Random message
SendClientMessage(playerid, 0xFF0000FF, "Kicked");
SetTimerEx("DelayedKick", 1000, false, "i", playerid);
return 1;
}
It's hard to explain, but basically, if the player types /Command (ANYNUMBER FROM 1-1000) they will be kicked? Cause I don't wanna type this a 1000 times i.e like this:
if(strcmp(cmdtext, "/Command 1", true) == 0)
{
//Random message
SendClientMessage(playerid, 0xFF0000FF, "Kicked");
SetTimerEx("DelayedKick", 1000, false, "i", playerid);
return 1;
}
if(strcmp(cmdtext, "/Command 2", true) == 0)
{
//Random message
SendClientMessage(playerid, 0xFF0000FF, "Kicked");
SetTimerEx("DelayedKick", 1000, false, "i", playerid);
return 1;
}
And so on..I'm terrible at describing things...sorry.