23.07.2015, 16:33
can any one make a timers for those cmds,when player get banned he didnt see the text and the dialog i need someone to make a time like first send the massege after that the dialog and after 2sec banned or kick the player.
ban cmd:
and kick cmd:
VBANID:
how to make it possible to the player to see the MSGS?
ban cmd:
Код:
CMD:ban(playerid,params[]) { if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][Level] >= 2) { new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); new str[500]; if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /Ban [playerid] [reason]"); if(!strlen(tmp2)) return SendClientMessage(playerid, red, "USAGE: /Ban [playerid] [reason]"); new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128]; player1 = strval(tmp); if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); new year,month,day,hour,minuite,second; getdate(year, month, day); gettime(hour,minuite,second); TogglePlayerControllable(player1,0); format(str,sizeof(string),"{FF0000}You Have been banned by Administrator %s | Reason: %s|.\n{FF0000}if you think you are Not guilty apply in our forum\n{FF0000}forum url==>www.codghosts-samp.tk",adminname,params[2]); ShowPlayerDialog(player1, DIALOG_WELCOMEB, DIALOG_STYLE_MSGBOX, "{FF9E00}You Have Been Banned", str, "Close", ""); CMDMessageToAdmins(playerid,"BAN"); format(string,sizeof(string),"{3BB023}» Admin action « {ABFF85}Admin %s has banned %s (Reason: %s).",adminname,playername,params[2]); SendClientMessageToAll(red,string); //format(string,sizeof(string),"[Reason: %s]",params[2]); //SendClientMessageToAll(red,string); SaveToFile("BanLog",string); for(new i = 1; i < MAX_REPORTS-1; i++) Reports[i] = Reports[i+1]; Bans[MAX_REPORTS-1] = string; print(string); if(udb_Exists(PlayerName2(player1)) && PlayerInfo[player1][LoggedIn] == 1) dUserSetINT(PlayerName2(player1)).("banned",1); format(string,sizeof(string),"banned by Administrator %s. Reason: %s", adminname, params[2] ); return VBanID(playerid,player1,params[2]); } else return SendClientMessage(playerid, red, "Player is not connected or is yourself or is the highest level admin"); } else return SendClientMessage(playerid,red,"» Error « {BABABA}You are not authorized to use this command."); } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands"); }
Код:
CMD:kick(playerid,params[]) { if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][Level] >= 1 || PlayerInfo[playerid][Helper] == 1) { new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /kick [playerid] [reason]"); new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128]; player1 = strval(tmp); if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); CMDMessageToAdmins(playerid,"KICK"); if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][Level] >= 1) { if(isnull(tmp2)) { format(string,sizeof(string),"{3BB023}» Admin action « {ABFF85}Administrator%s has Kicked %s (no reason given) ",adminname,playername,params[2]); SendClientMessageToAll(red,string); //format(string,sizeof(string),"[ No Reason Given ]",params[2]); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } else { format(string,sizeof(string),"{3BB023}» Admin action « {ABFF85}Administrator%s has Kicked %s ( Reason: %s )",adminname,playername,params[2],params[2]); SendClientMessageToAll(red,string); //format(string,sizeof(string),"[ Reason: %s ]",params[2]); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } } } if(PlayerInfo[playerid][Helper] == 1) { if(isnull(tmp2)) { format(string,sizeof(string),"%s has been kicked by Help operator %s [no reason given] ",playername,adminname); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } else { format(string,sizeof(string),"%s has been kicked by Help operator %s [reason: %s] ",playername,adminname,params[2]); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } } } else return SendClientMessage(playerid, red, "Player is not connected or is yourself or is the highest level admin"); } else return SendClientMessage(playerid,red,"» Error « {BABABA}You are not authorized to use this command."); } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands"); return 1; }
Код:
stock VBanID(playerid,giveid,reason[]) { format(NICKBAN,20,VBPlayer(giveid)); if(playerid > -1) { GetPlayerIp(giveid, VIP, sizeof(VIP)); format(Vnewban,32,BanDir,VIP); dini_Create(Vnewban); VBanSaveInfo(playerid,Vnewban,reason); format(Vnewban,32,BanDir,VBPlayer(giveid)); dini_Create(Vnewban); VBanSaveInfo(playerid,Vnewban,reason); } else { format(Vnewban,32,BanDir,VBPlayer(giveid)); dini_Create(Vnewban); VBanSaveInfo(-1,Vnewban,reason); } if(IsPlayerConnected(giveid)) VBanLoadInfo(giveid,Vnewban); Kick(giveid); return 1; }