[Pomoc] Ban ...

Započeo Rotcod, Avgust 29, 2010, 20:36:24 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

E ovako kao ja da napravim da samo jedna osoba moze ban da koristi recimo Pero_Simic x) to je neko ime i kako ja da napravim da on samo moze ban evo vam moja sadasnja cmd...

if(strcmp(cmd, "/ban", true) == 0) // Modded By CuervO_NegrO
{
   if(IsPlayerConnected(playerid))
   {
           new playersip[64];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ban [playerid/PartOfName] <reason>");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 3 || IsPlayerAdmin(playerid))
{
   if(IsPlayerConnected(giveplayerid))
   {
       if(giveplayerid != INVALID_PLAYER_ID)
       {
   GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerIp(giveplayerid,playersip,sizeof(playersip));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
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: /ban [playerid/PartOfName] [reason]");
return 1;
}
if(giveplayerid != playerid && Untouchable[giveplayerid]) return SendClientMessage(playerid, COLOR_GREY, "* You Can't Do this on This player!");
new targetlevel = PlayerInfo[giveplayerid][pAdmin];
new playerlevel = PlayerInfo[playerid][pAdmin];
if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "* You can not ban People that is higher Than You!");
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] %s Has been banned by %s for: %s",d,m,y,h,mi,s,giveplayer,sendername, (result));
BanLog(string);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Banned by %s - Reason: %s",d,m,y,h,mi,s,sendername,(result));
AddPunishment(giveplayerid, string);
format(string, sizeof(string), "%s (%d), Has been Banned by Administrator %s for %s", giveplayer, giveplayerid, sendername, (result));
SendClientMessageToAll(COLOR_NICERED, string);
format(string, sizeof(string), "[ADMIN]: %s Has Been Added to the Ban list by %s", playersip, sendername);
SendAdminMessage(COLOR_WHITE, string);
format(string, sizeof(string), "You have Been Banned by Administrator %s for %s", sendername, (result));
SendClientMessage(giveplayerid,COLOR_LIGHTBLUE, string);
SendClientMessage(giveplayerid,COLOR_BLUE, "If You Feel that This has Been an Error, Report the Admin to <changeme at 51586>");
SendClientMessage(giveplayerid,COLOR_BLUE, "To Get Unbanned Post an Unban Request at Our Forums <changeme at 51587>");
SendClientMessage(giveplayerid,COLOR_LIGHTRED, "Don't Evade, Otherwise you wont get unbanned");
      SafeSetPlayerPos(giveplayerid,264.6288,77.5742,1001.0391);
               SafeSetPlayerInterior(giveplayerid, 6);
  PlayerInfo[giveplayerid][pJailTime] = 300;
PlayerInfo[giveplayerid][pJailed] = 1;
format(string, sizeof(string), "~r~~h~Admin Ban: ~n~~r~%s",(result));
GameTextForPlayer(giveplayerid, string, 6000, 3);
PlayerInfo[giveplayerid][pPending] = 0;
Ban(giveplayerid);
return 1;
}
}//not connected
}
else
{
format(string, sizeof(string), "** %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_ORANGE, string);
}
}
return 1;
}
Poslednja Izmena: Avgust 29, 2010, 20:38:57 POSLE PODNE od David Guetta

Vidis di ti pise if (PlayerInfo[playerid][pAdmin] >= 3 || IsPlayerAdmin(playerid))

to zamjenis sa ovim: if((strcmp(PlayerName, "Ime", true) == 0) || (strcmp(PlayerName, "Ime_Prezime", true) == 0) || (strcmp(PlayerName, "Ime", true) == 0))

A kad dodajes vise osoba onda moras kopirat  (strcmp(PlayerName, "Ime_Prezime", true) == 0)  || dodat ove dvi ravne crte
         
         


aj mi ti to izmeni samo u onom gore pls treba mi za troje...
Poslednja Izmena: Avgust 29, 2010, 20:44:14 POSLE PODNE od David Guetta


Ipak dva dodacu ja jos jedan ako bude trebalo

ovako

1.David_Guetta 2.Jovan_Srki

if(strcmp(cmd, "/ban", true) == 0) // Modded By CuervO_NegrO
{
    if(IsPlayerConnected(playerid))
    {
            new playersip[64];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ban [playerid/PartOfName] <reason>");
return 1;
}
giveplayerid = ReturnUser(tmp);
if((strcmp(PlayerName, "David_Guetta", true) == 0) || (strcmp(PlayerName, "Jovan_Srki", true) == 0))
{
    if(IsPlayerConnected(giveplayerid))
    {
        if(giveplayerid != INVALID_PLAYER_ID)
        {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerIp(giveplayerid,playersip,sizeof(playersip));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
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: /ban [playerid/PartOfName] [reason]");
return 1;
}
if(giveplayerid != playerid && Untouchable[giveplayerid]) return SendClientMessage(playerid, COLOR_GREY, "* You Can't Do this on This player!");
new targetlevel = PlayerInfo[giveplayerid][pAdmin];
new playerlevel = PlayerInfo[playerid][pAdmin];
if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "* You can not ban People that is higher Than You!");
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] %s Has been banned by %s for: %s",d,m,y,h,mi,s,giveplayer,sendername, (result));
BanLog(string);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Banned by %s - Reason: %s",d,m,y,h,mi,s,sendername,(result));
AddPunishment(giveplayerid, string);
format(string, sizeof(string), "%s (%d), Has been Banned by Administrator %s for %s", giveplayer, giveplayerid, sendername, (result));
SendClientMessageToAll(COLOR_NICERED, string);
format(string, sizeof(string), "[ADMIN]: %s Has Been Added to the Ban list by %s", playersip, sendername);
SendAdminMessage(COLOR_WHITE, string);
format(string, sizeof(string), "You have Been Banned by Administrator %s for %s", sendername, (result));
SendClientMessage(giveplayerid,COLOR_LIGHTBLUE, string);
SendClientMessage(giveplayerid,COLOR_BLUE, "If You Feel that This has Been an Error, Report the Admin to <changeme at 51586>");
SendClientMessage(giveplayerid,COLOR_BLUE, "To Get Unbanned Post an Unban Request at Our Forums <changeme at 51587>");
SendClientMessage(giveplayerid,COLOR_LIGHTRED, "Don't Evade, Otherwise you wont get unbanned");
      SafeSetPlayerPos(giveplayerid,264.6288,77.5742,1001.0391);
                SafeSetPlayerInterior(giveplayerid, 6);
    PlayerInfo[giveplayerid][pJailTime] = 300;
PlayerInfo[giveplayerid][pJailed] = 1;
format(string, sizeof(string), "~r~~h~Admin Ban: ~n~~r~%s",(result));
GameTextForPlayer(giveplayerid, string, 6000, 3);
PlayerInfo[giveplayerid][pPending] = 0;
Ban(giveplayerid);
return 1;
}
}//not connected
}
else
{
format(string, sizeof(string), "** %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_ORANGE, string);
}
}
return 1;
}
Poslednja Izmena: Avgust 29, 2010, 21:13:52 POSLE PODNE od Sepo|TGS


Ja ti rekoh ovu gore cmd ban a ne to  ??? ??? ???

loool pa samo zamjenis onaj red sto ti je on dao sa imenima...sa onim Admin,u /ban

Gledajte eror sve sam ok uradio i gledajte:

Linija:
   if((strcmp(PlayerName, "David_Guetta", true) == 0) || (strcmp(PlayerName, "Jovan_Srki", true) == 0))
Eror:
error 076: syntax error in the expression, or invalid function call

Da mozda netreba u new da se stavi new David_Guetta i new Jovan_Srki

if(strcmp(PlayerName, "David_Guetta", true) == 0 || strcmp(PlayerName, "Jovan_Srki", true) == 0)

ovo??
Aequam memento rebus in arduis servare mentem.

da to nes nevalja ima error

sad ovako cmd izgleda:


if(strcmp(cmd, "/ban", true) == 0) // Modded By CuervO_NegrO
{
   if(IsPlayerConnected(playerid))
   {
           new playersip[64];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /ban [ID/Deo imena] <razlog>");
return 1;
}
giveplayerid = ReturnUser(tmp);
if((strcmp(PlayerName, "David_Guetta", true) == 0) || (strcmp(PlayerName, "Jovan_Srki", true) == 0))
{
   if(IsPlayerConnected(giveplayerid))
   {
       if(giveplayerid != INVALID_PLAYER_ID)
       {
   GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerIp(giveplayerid,playersip,sizeof(playersip));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
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, "KORISTI: /ban [ID/Deo imena] <razlog>");
return 1;
}
if(giveplayerid != playerid && Untouchable[giveplayerid]) return SendClientMessage(playerid, COLOR_GREY, "* You Can't Do this on This player!");
new targetlevel = PlayerInfo[giveplayerid][pAdmin];
new playerlevel = PlayerInfo[playerid][pAdmin];
if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "* Ti nemozes banovati admina veceg levela!");
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] %s Je banovan od %s za: %s",d,m,y,h,mi,s,giveplayer,sendername, (result));
BanLog(string);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Banovan od %s - Razlog: %s",d,m,y,h,mi,s,sendername,(result));
AddPunishment(giveplayerid, string);
format(string, sizeof(string), "%s (%d), Je banovan od admina %s za %s", giveplayer, giveplayerid, sendername, (result));
SendClientMessageToAll(COLOR_NICERED, string);
format(string, sizeof(string), "[ADMIN]: %s Je banovan i dodat u lsitu banova %s", playersip, sendername);
SendAdminMessage(COLOR_WHITE, string);
format(string, sizeof(string), "Ti si banovan/na %s za %s", sendername, (result));
SendClientMessage(giveplayerid,COLOR_LIGHTBLUE, string);
SendClientMessage(giveplayerid,COLOR_BLUE, "If You Feel that This has Been an Error, Report the Admin to <changeme at 51586>");
SendClientMessage(giveplayerid,COLOR_BLUE, "To Get Unbanned Post an Unban Request at Our Forums <changeme at 51587>");
SendClientMessage(giveplayerid,COLOR_LIGHTRED, "Don't Evade, Otherwise you wont get unbanned");
      SafeSetPlayerPos(giveplayerid,264.6288,77.5742,1001.0391);
               SafeSetPlayerInterior(giveplayerid, 6);
  PlayerInfo[giveplayerid][pJailTime] = 300;
PlayerInfo[giveplayerid][pJailed] = 1;
format(string, sizeof(string), "~r~~h~Admin Ban: ~n~~r~%s",(result));
GameTextForPlayer(giveplayerid, string, 6000, 3);
PlayerInfo[giveplayerid][pPending] = 0;
Ban(giveplayerid);
return 1;
}
}//not connected
}
else
{
format(string, sizeof(string), "** %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_ORANGE, string);
}
}
return 1;
}

Poslednja Izmena: Avgust 29, 2010, 22:14:32 POSLE PODNE od David Guetta