kick, ban

Započeo Å minker, April 09, 2010, 02:23:24 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Å minker

moze mi netko rec kako da slozim kick i ban komande
kad ukucam npr /ban pise mi /ban : you are not admin
a kad ukucam kick
pise mi
/kick : you are not admin
a admin 1338 sam :S

Evo ti BAN
if(strcmp(cmd, "/ban", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "/ban [igracevId/dio imena] [razlog]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
    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, "/ban [igracevId/dio imena] [razlog]");
return 1;
}
new year, month,day;
getdate(year, month, day);
format(string, sizeof(string), "Obavijest: %s je banan od strane Admina %s, Razlog: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
BanLog(string);
format(string, sizeof(string), "Obavijest: %s je banan od strane Admina %s, Razlog: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
PlayerInfo[giveplayerid][pAdmin] = PlayerInfo[giveplayerid][pLevel];
PlayerInfo[giveplayerid][pLevel] = -999;
Ban(giveplayerid);
return 1;
}
}//not connected
}
else
{
format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}

Evo ti KICK
if(strcmp(cmd, "/kick", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "/kick [igracevID/dio imena] [razlog");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
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, "/kick [igracevID/dio imena] [razlog]");
return 1;
}
new year, month,day;
getdate(year, month, day);
format(string, sizeof(string), "Obavijest: %s je kickan od strane Admina %s, Razlog: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
KickLog(string);
Kick(giveplayerid);
format(string, sizeof(string), "Obavijest: %s je kickan od strane Admina %s, Razlog: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
return 1;
}
}
}
else
{
format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}

Å minker

Moze lock
zezala me FS base :S

moze ti biti i zato jer mozda samo rcon admini mogu banati/kickati...