Kick using sscanf
#1

Hello!

For kick, I need player name or id. So, if I put sscanf parameter "u" for player name or id, how can I know when player type name or id?
Sorry for my bad english. :/
Reply
#2

"u" =name or id (this is bugged in my tests..it works 80% of the time and in the other 20% it returns a random text,integer or float)
"d" = ID//integer
"s" = string

I don't know if this is what u mean
Anway, good luck!
Reply
#3

command(kick,playerid,params[])
{
new Temp[24],Reason[128];

if(Player[playerid][Admin] == ADMIN_OWNER)
{

}
else
{
ShowNotificationMessage(playerid,"~r~Warning Message~n~ ~n~ ~n~ ~n~ ","You need to be Server Owner to use this command.",5);
}

if(!sscanf(params,"us",Temp,Reason))
{
if(!IsNumeric
GetPlayer
}
else
{
ShowNotificationMessage(playerid,"~r~Warning Message~n~ ~n~ ~n~ ~n~ ","Usage: /kick <~y~ID or Name~w~> <~y~Reason~w~>.",5);
}
return 1;
}

-----------------------------------------------------------------------

This will be my kick command. I want to ask, what must I put where it is bold text. Integer or String?
Reply
#4

Check the wiki's article on sscanf, there is a kick command using it(with zcmd or dcmd, I can't remember)that you can edit to your liking.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)