#1

http://zaslike.com/viewer.php?file=i...hps6cgu5p8.jpg

Код:
CMD:kick(playerid,params[])
{
    new id,name1[MAX_PLAYER_NAME], reason[35],name2[MAX_PLAYER_NAME], string[128];
    if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_LIGHTRED,"SERVER:Nisi admin!");
    if(sscanf(params,"uz",id,reason)) return SCM(playerid, COLOR_WHITE,"HELP: /kick [id/Ime_Prezime] [razlog]");
    if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_LIGHTRED,"SERVER:Taj igrac nije online.");
    else
    {
	    GetPlayerName(playerid,name1,sizeof(name1));
	    GetPlayerName(id,name2,sizeof(name2));
	    format(string, sizeof(string),"SERVER: %s je kickan od admina %s, razlog: %s",name2,name1,reason);
	    SendClientMessageToAll(COLOR_RED,string);
	    Kick(id);
    }
    return 1;
}
Typing / kick Jack_Tiks Test and writes SERVER: This player is not online and I was online and throw me into a server problem
Reply
#2

You have the lastest sscanf?
Reply
#3

Re-download sscanf, had same problem.
Reply
#4

[17:31:33] sscanf warning: 'z' is deprecated, consider using 'S' instead.
[17:31:33] sscanf warning: No default value found.
[17:31:33] sscanf warning: Strings without a length are deprecated, please add a destination size.
Reply
#5

pawn Код:
if(sscanf(params,"us[129]",id,reason))
Reply
#6

This player is not online :O
Reply
#7

Quote:
Originally Posted by antonio600x
Посмотреть сообщение
This player is not online :O
Quote:
Originally Posted by varthshenon
Посмотреть сообщение
You have the lastest sscanf?
Have you?
Reply
#8

I update now and player is not online :OOOOOOOOOOOOO
Reply
#9

Thats a bit of a mess, try this:

Quote:

CMD:kick(playerid, params[])
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");

new reason[128], giveplayerid;
if(AdminLevel[playerid] < 1) return SendClientMessage(playerid, COLOUR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "us[128]", giveplayerid, reason)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /kick [player id] [reason]");
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOUR_GREY, "That player is not connected.");

format(reason, sizeof(reason), "Admin %s Kicked %s [Reason : %s ]", GetNameEx(playerid), GetNameEx(giveplayerid), reason);
SendClientMessageToAll(COLOUR_LIGHTRED, reason);
Kick(giveplayerid);
return 1;
}

Reply
#10

remove the is player online check and set up ur own variable like:

pawn Код:
IsPlayerLoggedIn[MAX_PLAYERS];

//OnPlayerConnect
IsPlayerLoggedIn[playerid]=0;

//After ur login proceeds:
IsPlayerLoggedIn[playerid]=1;

//OnPlayerDisconnect
IsPlayerLoggedIn[playerid]=0;

//Ur cmd
if(IsPlayerLoggedIn[playerid]==0) return SendClientMessage(/*your message that hes not online*/);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)