What's wrong -.-
#1

SOLVED.
Reply
#2

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;
}
Reply
#3

deleted
Reply
#4

-DELETED.
Reply
#5

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...
Reply
#6

z in sscanf is deprecated. Use s for a required string, S for an optional.
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)