Posts: 61
Threads: 21
Joined: May 2009
Reputation:
0
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. :/
Posts: 8
Threads: 0
Joined: Feb 2008
Reputation:
0
"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!
Posts: 61
Threads: 21
Joined: May 2009
Reputation:
0
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?
Posts: 546
Threads: 44
Joined: Jan 2010
Reputation:
0
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.