#1

how can I make like this so I cant kick the player "DarkNighter" ??
Reply
#2

pawn Код:
public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    if(!strcmp(name,"DarkNighter",true))
    {
        Kick(playerid);
    }
    return 1;
}
Reply
#3

and other players cant kick me..

Quote:

if(strcmp(cmd, "/kick", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kick [playerid/PartOfName] [motiv]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGm] >= 3)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kick [playerid/PartOfName] [motiv]");
return 1;
}
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_RED,"AdmCmd: Nu iti poti da kick singur.");
return 1;
}
new year, month,day;
getdate(year, month, day);
new Hour, Min, Sec;
gettime(Hour, Min, Sec);
new targetlevel = PlayerInfo[giveplayerid][pAdmin];
new playerlevel = PlayerInfo[playerid][pAdmin];
if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "* Are functie mai mare decat tine !");
format(string, sizeof(string), "AdmCmd: %s a primit kick de la %s, Motiv: %s!",giveplayer, sendername,(result));
SendClientMessageToAll(COLOR_RED, string);
format(string, sizeof(string), "AdmCmd: %s a primit kick pe data de : | %d/%d/%d | ora | %02d:%02d:%02d | ",giveplayer,day,month,year,Hour, Min, Sec);
SendClientMessageToAll(COLOR_RED, string);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) AdmCmd: %s a primit kick de la %s, Motiv: %s!",d,m,y,h,mi,s,giveplayer, sendername,(result));
KickLog(string);
Kick(giveplayerid);
return 1;
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}

Reply
#4

Use this but now you must be logen as RCON ADMIN

pawn Код:
if(strcmp(cmd, "/kick", true) == 0)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000, "* Only Admins can use this comamnd!");
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kick [playerid/PartOfName] [motiv]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGm] >= 3)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kick [playerid/PartOfName] [motiv]");
return 1;
}
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_RED,"AdmCmd: Nu iti poti da kick singur.");
return 1;
}
new year, month,day;
getdate(year, month, day);
new Hour, Min, Sec;
gettime(Hour, Min, Sec);
new targetlevel = PlayerInfo[giveplayerid][pAdmin];
new playerlevel = PlayerInfo[playerid][pAdmin];
if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "* Are functie mai mare decat tine !");
format(string, sizeof(string), "AdmCmd: %s a primit kick de la %s, Motiv: %s!",giveplayer, sendername,(result));
SendClientMessageToAll(COLOR_RED, string);
format(string, sizeof(string), "AdmCmd: %s a primit kick pe data de : | %d/%d/%d | ora | %02d:%02d:%02d | ",giveplayer,day,month,year,Hour, Min, Sec);
SendClientMessageToAll(COLOR_RED, string);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) AdmCmd: %s a primit kick de la %s, Motiv: %s!",d,m,y,h,mi,s,giveplayer, sendername,(result));
KickLog(string);
Kick(giveplayerid);
return 1;
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
Reply
#5

not like this..i don't want it rcon....I want admins on name..so they cant kick me..can it be like that?
Reply
#6

ENG: Hmm, just let me think you want admins on name , no that isn't possible because you use strtok
RO: Foloseste zcmd + sscanf , ca o sa ai de munca taticule daca vrei cu strtok , atat iti zic bafta!
Reply
#7

I don't know how..
Reply
#8

https://sampforum.blast.hk/showthread.php?tid=300397
Just look at this
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)