[Pomoc] Ban/Kick

Započeo MEMOREX™️, Decembar 23, 2011, 14:47:14 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Skripta koju koristim: Moja
Detaljan opis problema: Zanima me kako da uradim komnadu /ban i /kick da admini 1,2,3,4,1337 nemogu banat i kickat 1338 admin-a? Ostalo sve isto samo da to nemogu banat i kickat admina 1338.
Dio skripte:
Ban Komanda:

if(strcmp(cmd, "/ban", true) == 0)
{
   if(IsPlayerConnected(playerid))
   {
           new playersip[64];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_DGOLD, "KORISTENJE: /ban [ID/DioImena] [razlog]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pGameMaster] >= 2 || IsPlayerAdmin(playerid))
{
   if(IsPlayerConnected(giveplayerid))
   {
       if(giveplayerid != INVALID_PLAYER_ID)
       {
   GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
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/DioImena] [razlog]");
return 1;
}
new targetlevel = PlayerInfo[giveplayerid][pAdmin];
new playerlevel = PlayerInfo[playerid][pAdmin];
if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "ERROR: Nemozes banati veci adm lvl od sebe!");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string), "%s je dobio ban od %s.Razlog: %s" , giveplayer,sendername, (result));
BanLog(string);
format(string, sizeof(string), "SERVER: %s je dobio ban od %s.Razlog: %s.", giveplayer,  sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
format(string, sizeof(string), "[BAN LOG]: %s je pridodan u listu bananih od strane administratora %s", playersip, sendername);
SendAdminMessage(COLOR_YELLOW, string);
ClearChatbox(giveplayerid, 100);
new y, m, d;
   new h,mi,s;
   getdate(y,m,d);
   gettime(h,mi,s);
                       format(string, sizeof(string), "----------------------------------------------[BAN]--------------------------------------------", sendername );
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "SERVER: Dobili ste ban od administratora %s", sendername);
SendClientMessage(giveplayerid,COLOR_WHITE, string);
format(string, sizeof(string), "RAZLOG: %s.", (result));
SendClientMessage(giveplayerid,COLOR_WHITE, string);
format(string, sizeof(string), "VRIJEME & DATUM: (%d/%d/%d) - [%d:%d:%d].", d,m,y,h,mi,s);
SendClientMessage(giveplayerid,COLOR_WHITE, string);
SendClientMessage(giveplayerid,COLOR_WHITE, "SERVER: Ako mislite da je doslo do greske obratite se na forumu.");
SendClientMessage(giveplayerid,COLOR_WHITE, "SERVER: Vas Cro Balkan Admin Team");
                       format(string, sizeof(string), "------------------------------------------------------------------------------------------------", sendername );
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
      Ban(giveplayerid);
return 1;
}
}//not connected
}
else
{
format(string, sizeof(string), "** %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_ORANGE, string);
}
}
return 1;
}

Kick Komanda:

   if(strcmp(cmd, "/kick", true) == 0)
{
   if(IsPlayerConnected(playerid))
   {
     tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_DGOLD, "KORISTENJE: /kick [ID/DioImena] [razlog]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGameMaster] >= 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_DGOLD, "KORISTENJE: /kick [playerid/DioImena] [reason]");
return 1;
}

format(string, sizeof(string), "SERVER: %s je dobio kick od %s. Razlog: %s.", giveplayer, sendername, (result));
KickLog(string);
format(string, sizeof(string), "SERVER: %s je dobio kick od %s. Razlog: %s.", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
ClearChatbox(giveplayerid, 100);
format(string, sizeof(string), "----------------------------------------------[KICK]-------------------------------------------", sendername );
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "SERVER: Dobili ste kick sa servera od strane administratora %s", sendername );
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "RAZLOG: %s." , (result));
SendClientMessage(giveplayerid, COLOR_WHITE, string);
SendClientMessage(giveplayerid, COLOR_WHITE,"SERVER: Ukoliko mislite da je doslo do greske - obratite se na forumu.");
SendClientMessage(giveplayerid, COLOR_WHITE,"Vas Cro Balkan Admin Team");
format(string, sizeof(string), "------------------------------------------------------------------------------------------------", sendername );
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
Kick(giveplayerid);
return 1;
}
}
}
else
{
format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): //

Ako nesto nerazumete msm sta zelim da kazem sa ovime. Javite mi
Poslednja Izmena: Decembar 23, 2011, 14:48:48 POSLE PODNE od Memorexâ„¢
Skriptam za pare

if(playerlevel >= 1 && playerlevel < 1338) { if(targetlevel == 1338) return SendClientMessage(playerid,-1,"nemos banat 1338 admina!"); }

Citat: Explode.ba poslato Decembar 23, 2011, 15:02:18 POSLE PODNE
if(playerlevel >= 1 && playerlevel < 1338) { if(targetlevel == 1338) return SendClientMessage(playerid,-1,"nemos banat 1338 admina!"); }

Ako moze objasnjenje gde da stavim tu Liniju? Ili mi ti uredis komandu.
Skriptam za pare


ovo mi izbaci:

gamemodes\crobalkan.pwn(38873) : error 017: undefined symbol "playerlevel"
gamemodes\crobalkan.pwn(38873) : error 017: undefined symbol "targetlevel"
gamemodes\crobalkan.pwn(38923) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.



Kako da definiram ono PlayerLevel i Targetlevel?
Skriptam za pare

pa imaš ih u komandi već to playerlevel i targetlevel sam iskopiro iz tvojih komandi

EDIT:

vidim da si edito komande

onda samo ubaci

new playerlevel = PlayerInfo[playerid][pAdmin];
new targetlevel = PlayerInfo[giveplayerid][pAdmin];
Poslednja Izmena: Decembar 23, 2011, 15:38:06 POSLE PODNE od Explode.ba

Hvala. Sve sam rjesio .... Hvala jos jednom ;)
Poslednja Izmena: Decembar 23, 2011, 15:56:57 POSLE PODNE od Memorexâ„¢
Skriptam za pare