SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 15/03/2016, 08:47 PM   #1
rouse
Little Clucker
 
Join Date: Mar 2016
Posts: 1
Reputation: 0
Default ban cmd > timeban pls!

{bad english -,-}



i can /ban [playerid] [reason] instead > /ban [playerid] [today/space] [reason]

/ban 5 hack
> Joseph William banned by admin Mark, Reason: hack
/ban 5 20 hack
> Joseph William 20 days banned by admin Mark, Reason: hack

PHP Code:
CMD:ban(playeridparams[]) {
    if(
PlayerInfo[playerid][pAdmin] >= 2) {
        if(
AdminDuty[playerid] != && PlayerInfo[playerid][pAdmin] < 7)
        {
            
SendClientMessage(playerid,COLOR_WHITE"Yönetici komutlarına erişmek için işbaşı yapman gerekiyor, işbaşı yapmak için /aduty komutunu kullan.");
            return 
1;
        }
        new 
string[128], giveplayeridreason[64];
        if(
sscanf(params"us[64]"giveplayeridreason)) return SendClientMessage(playeridCOLOR_WHITE"KULLANIM: /ban [Oyuncu ID/İsim] [sebep]");

        if(
IsPlayerConnected(giveplayerid)) {
            if(
PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin]) {
                if(
AdminDuty[playerid] == 1) {
                    new 
username[MAX_PLAYER_NAME];
                    
GetPVarString(playerid"TempNameName"usernamesizeof(username));
                    
SetPVarInt(playerid"TempName"0);
                    
SetPlayerName(playeridusername);
                }

                
format(stringsizeof(string), "AdminKomutu: %s otomatik olarak yasaklandı, sebep: Kendinden yüksek seviye yöneticiyi yasaklamaya çalışmak"PlayerInfo[playerid][pAdminName]);
                
ABroadCast(COLOR_YELLOW,string,1);
                
PlayerInfo[playerid][pBanned] = 1;
                new 
ip[32];
                
GetPlayerIp(playerid,ip,sizeof(ip));
                
AddBan(ip);
                
Kick(playerid);
                return 
1;
            } else {
                new 
playerip[32];
                
GetPlayerIp(giveplayeridplayeripsizeof(playerip));

                if(
AdminDuty[giveplayerid] == 1) {
                    new 
username[MAX_PLAYER_NAME];
                    
GetPVarString(giveplayerid"TempNameName"usernamesizeof(username));
                    
SetPVarInt(giveplayerid"TempName"0);
                    
SetPlayerName(giveplayeridusername);

                    
format(stringsizeof(string), "AdminKomutu: %s(IP:%s), %s tarafından yasaklandı, sebep: %s"PlayerInfo[giveplayerid][pAdminName], playeripGetPlayerNameEx(playerid), reason);
                    
Log("logs/ban.log"string);

                    
format(stringsizeof(string), "AdminKomutu: %s adlı oyuncu %s tarafından yasaklandı, sebep: %s"PlayerInfo[giveplayerid][pAdminName], GetPlayerNameEx(playerid), reason);
                } else {
                    
format(stringsizeof(string), "AdminKomutu: %s(IP:%s), %s tarafından yasaklandı, sebep: %s"GetPlayerNameEx(giveplayerid), playeripGetPlayerNameEx(playerid), reason);
                    
Log("logs/ban.log"string);

                    
format(stringsizeof(string), "AdminKomutu: %s adlı oyuncu %s tarafından yasaklandı, sebep: %s"GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
                }

                
SendClientMessageToAllEx(COLOR_LIGHTREDstring);
                
PlayerInfo[giveplayerid][pBanned] = 1;
                new 
ip[32];
                
GetPlayerIp(giveplayerid,ip,sizeof(ip));
                
AddBan(ip);
                
Kick(giveplayerid);
                return 
1;
            }

        }
        else 
SendClientMessage(playeridCOLOR_GRAD1"Geçersiz oyuncu.");
    }
    else 
SendClientMessage(playeridCOLOR_GRAD1"Bu komutu kullanma yetkiniz yok!");
    return 
1;

rouse is offline   Reply With Quote
Old 15/03/2016, 08:52 PM   #2
Jensenn
Banned
 
Join Date: Apr 2014
Location: PAWN Coder
Posts: 100
Reputation: 8
Default Re: ban cmd > timeban pls!

------ wrong
Jensenn is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[NEED] Timeban Fantje Scripting Help 2 15/03/2015 01:32 PM
Timeban EmpireSk Scripting Help 2 14/01/2015 08:23 PM
Timeban EmpireSk Scripting Help 4 21/08/2013 11:51 AM
Timeban sim_sima Scripting Help 3 23/11/2011 01:24 PM
Timeban command - Help! Striker_Moe Help Archive 8 08/09/2009 11:10 AM


All times are GMT. The time now is 06:30 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.