[POMOC]Ban...

Započeo [GP]Brain
1. Jul 2013. Zaključano
320
pregleda
4
postova
Jacky1
4
Made Man
1. Jul 2013.
Skripta koju koristim: geforce
Detaljan opis problema: Jel moze komanda u strcmp za ban account samo acc ono CreateBanFile tako nesto jer imam vec komandu /ban bana acc i ip a acc doda u scriptfiles/Banovi  i komandu imam /banip samo za ip sad bi tio komandu samo za acc ban
Dio skripte: /
Neke slike/video za lakse dobivanje pomoci(neobavezno): /
BocaBajrovic1995
5
Kingpin
1. Jul 2013.
Valjda ovo trazis
if(strcmp(cmd, "/ban", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ban [playerid/PartOfName] ");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo >= 2)
{
    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++;
}
new offset = idx;
new result;
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext;
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ban [id igraca/deo nicka] ");
return 1;
}
new year, month,day;
getdate(year, month, day);
format(string, sizeof(string), "AdmCmd: %s je iskljucen od Admina %s zbog sledeceg razloga: %s (datum: %d-%d-%d)", giveplayer, sendername, (result),month,day,year);
BanLog(string);
format(string, sizeof(string), "AdmCmd: %s je iskljucen od Admina %s, zbog sledeceg razloga: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
PlayerInfo = PlayerInfo;
PlayerInfo = -999;
Ban(giveplayerid);
return 1;
}
}//not connected
}
else
{
format(string, sizeof(string), "  Igrac %d nije aktivan.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
Edit: Predlazem ti da radis komande u zcmd ili yini jel ti je strcmp proces komandi mnogo spor 🙂
Jacky1
4
Made Man
1. Jul 2013.
Imam komandu /BANIP za banat ip i komandu /BAN za banat IP I ACCOUNT  trebam komandu npr /banacc za banat SAMO ACCOUNT da ip ostane netaknut ti si mi dao za ip banovat znaci kad /banacc da mu napravi ono sranje u scriptfiles/Banovi da mu tu doda ime acc-a i da  je acc banovan evo ti komanda /ban za acc i ip:
	if(strcmp(cmd, "/ban", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTENJE: /ban [Playerid/DioImena] ");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo >= 2)
{
    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++;
}
new offset = idx;
new result;
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext;
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTENJE: /ban [Playerid/DioImena] ");
return 1;
}
if (!GetPVarInt(giveplayerid, "gPlayerLogged"))
{
    SendClientMessage(playerid, COLOR_RED, "Taj igrac nije logiran.");
return 1;
}
                        new playersip;
new year, month, day;
new hours, minutes, seconds;
GetPlayerIp(giveplayerid,playersip,sizeof(playersip));
getdate(year, month, day);
gettime(hours, minutes, seconds);
ServerInfo++;
format(string, sizeof(string), "[GP:RPG]: %s [IP: %s] je dobio ban od admina %s.  Razlog: %s (%d-%d-%d)", giveplayer, playersip, sendername, (result),day,month,year);
BanLog(string);
format(string, sizeof(string), "[GP:RPG]: %s je dobio ban od admina %s.  Razlog: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
                        ClearChatBox(giveplayerid);
                        SendClientMessage(giveplayerid, COLOR_RED,"[GP:RPG]: Dobili ste ban.");
                        SendClientMessage(giveplayerid, COLOR_RED,"[GP:RPG]: Vas Account i Vasa IP adresa su banovani.");
                        format(string, sizeof(string), " - Admin: %s", sendername);
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                        format(string, sizeof(string), " - Razlog: %s", (result));
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
            format(string, sizeof(string), " - Vasa IP adresa: %s", playersip);
                SendClientMessage(giveplayerid, COLOR_WHITE, string);
            format(string, sizeof(string), " - Datum: %d/%d/%d | %d:%d:%d", day,month,year,hours,minutes,seconds);
                SendClientMessage(giveplayerid, COLOR_WHITE, string);
                SendClientMessage(giveplayerid, COLOR_RED,"[GP:RPG]: Ako mislite da niste zasluzili ban molimo vas da se obratite na forum.");
                        CreateBanFile(giveplayer);
SetTimerEx("BanIgraca", 500, 0, "d", giveplayerid);
return 1;
}
}
}
else
SendClientMessage(playerid, COLOR_RED, "Taj igrac nije online!");
}
return 1;
}

to je ovo CreateBanFile(giveplayer); ja msm i tako
James_SmithXDl
6
OG Legend
1. Jul 2013.
if(strcmp(cmdtext, "/ban", true) == 0)
{
if(!IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, 0xFF0000FF, "Nisi admin.");
return 1;
}

new idplayer,
razlog,
banovanod,
banovan,
forplayersban,
savetofilestr,
godina,
mjesec,
dan,
sat,
minuta,
sekunda,
banip;

if(sscanf(cmdtext, "ds", idplayer, razlog))
{
SendClientMessage(playerid, 0xFF0000FF, "Koristi: /ban id razlog");
return 1;
}
if(!IsPlayerConnected(idplayer))
{
SendClientMessage(playerid, 0xFF0000FF, "Invalid ID");
return 1;
}
GetPlayerName(playerid, banovanod, sizeof(banovanod));
GetPlayerName(idplayer, banovan, sizeof(banovan));
GetPlayerIp(idplayer, banip, sizeof(banip));
format(forplayersban, sizeof(forplayersban), "%s (%d)je banovan od %s. razlog: %s.", banovan, idplayer, banovanod, razlog);
SendClientMessageToAll(0xFF0000FF, forplayersban);
baningpe = fopen("ban.log", io_append);
getdate(godina, mjesec, dan);
gettime(sat, minuta, sekunda);
format(savetofilestr, sizeof(savetofilestr), "[%02d:%02d:%02d | %02d/%02d/%d] %s IP: %s\n",sat, minuta, sekunda, dan, mjesec, godina, forplayersban, banip);
fwrite(baningpe, savetofilestr);
fclose(baningpe);
return 1;
}

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha