SA-MP Forums Archive
Kick using sscanf - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Kick using sscanf (/showthread.php?tid=144886)



Kick using sscanf - MummyKillerSLO - 29.04.2010

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. :/


Re: Kick using sscanf - Roytjuh - 29.04.2010

"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!


Re: Kick using sscanf - MummyKillerSLO - 29.04.2010

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?


Re: Kick using sscanf - biltong - 29.04.2010

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.