What's wrong -.- - 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)
+--- Thread: What's wrong -.- (
/showthread.php?tid=315275)
What's wrong -.- -
vassilis - 02.02.2012
SOLVED.
Re: What's wrong -.- -
Littlehelper - 02.02.2012
My Kick System, it gives reason also ^_^
Code:
COMMAND:kick(playerid, params[])
{
new string[127];
new targetid,String[156];
if(sscanf(params,"us", targetid,String)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /kick [playerid] [REASON]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "Invalide PlayerID"RED"(Player Is Not Connected)!");
if(targetid == playerid) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You Can't kick Yourself!");
if(String[0] <= 5) return SendClientMessage(playerid, COLOR_YELLOW, "Your Reason Must Be More Than 5 Characters");
new OtherN[MAX_PLAYER_NAME], PlayerN[MAX_PLAYER_NAME];
GetPlayerName(targetid, OtherN, sizeof(OtherN));
GetPlayerName(playerid, PlayerN, sizeof(PlayerN));
Kick(targetid);
format(string, sizeof(string), "%s Was kicked By Admin %sReason: %s",PlayerN, OtherN,String);
SendClientMessageToAll(COLOR_BRIGHTRED, string);
printf("\"%s\"Was kicked By Admin \"%s\" Reason %s",PlayerN, OtherN,String);
return 1;
}
Re: What's wrong -.- -
BoyDenker - 02.02.2012
deleted
Re: What's wrong -.- -
Littlehelper - 02.02.2012
-DELETED.
Re: What's wrong -.- -
Babul - 02.02.2012
which sscanf version are you using? iam curious coz you use the "z" specifier. with the new plugin, a specifier like "S(cheaters dont play here)[32]" ? the optional string will get filled with the reason, if you dont type it with the command. using the "s[50]" specifier makes it not optional, so it should fail when you dont type the reason...
Re: What's wrong -.- -
MP2 - 02.02.2012
z in sscanf is deprecated. Use s for a required string, S for an optional.
Re: What's wrong -.- -
vassilis - 02.02.2012
littlehelper thanks for the help i just changed uz to us and got fixed xD
EDIT:
Babul ye i forgot that z is optional string now more thanks.