kick command not working.
#9

Quote:
Originally Posted by fuckingcruse
Посмотреть сообщение
Try this..

Код:
CMD:kick(playerid, params[])
{
	new toplayerid, reason[24], string[126];
    if(!Player[playerid][Admin] >= 1) return SendClientMessage(playerid, color_grey, "You are not authorized to use that command.");
        

	if (sscanf(params, "ii", toplayerid, reason))
 	{
  		SendClientMessage(playerid, color_grey, "UTILIZARE:/kick <playerid/name> <motiv>");
 	}
	format(string, sizeof(string), "%s has been kicked by %s, reason: %s", toplayerid, playerid, reason);
	SendClientMessageToAll(color_red, string);
	Kick(toplayerid);
    
    return 1;
}
Try it. and dont be so complicated try the easiest way to present codes!
Quote:

Scripting for money , except Mysql and textdraws , I can script everything.

PHP код:
sscanf(params"ii"toplayeridreason
Are you serious? You just asking sscanf to scan 'params' for 2 integers, while the reason is string.. ._.
And this signature tho, You can't even use sscanf..
I wont be pussy here so..
Lemme post something to help topic owner.

PHP код:
CMD:kick(playeridparams[])
{
    new 
idreason[24];
    if(
sscanf(params"us[24]"idreason)) return SendClientMessage(playeridcolor_grey"UTILIZARE:/kick <playerid/name> <motive>");
    else if(
Player[playerid][Admin] < 1) return  SendClientMessage(playeridcolor_grey"You are not authorized to use that command.");
    else if(!
IsPlayerConnected(id)) return SendClientMessage(playeridcolor_grey"Invalid Player.");
    else
    {
        new 
tmpstr[128], pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
        
GetPlayerName(idpNamesizeof(pName));
        
GetPlayerName(playeridaNamesizeof(aName));
        
format(tmpstrsizeof(tmpstr), "%s has been kicked by %s, reason: %s"pNameaNamereason);
        
SendClientMessageToAll(color_redtmpstr);
        
Kick(id);
    }
    return 
1;

Cheers.
Reply


Messages In This Thread
kick command not working. - by SpikeSpigel - 29.10.2015, 16:17
Re: kick command not working. - by jlalt - 29.10.2015, 16:20
Re: kick command not working. - by SpikeSpigel - 29.10.2015, 16:24
Re: kick command not working. - by AbyssMorgan - 29.10.2015, 16:25
Re: kick command not working. - by fuckingcruse - 29.10.2015, 16:27
Re: kick command not working. - by AbyssMorgan - 29.10.2015, 16:28
Re: kick command not working. - by SpikeSpigel - 29.10.2015, 16:33
Re: kick command not working. - by AbyssMorgan - 29.10.2015, 16:37
Re: kick command not working. - by iKarim - 29.10.2015, 16:40

Forum Jump:


Users browsing this thread: 1 Guest(s)