22.04.2011, 17:11
Galera nas todas as Enum das contas salva menos a de aAdmin e Admin. EU ALTERO PARA 5 OS DOIS AI DEPOIS QUANDO SAIO DA CONTA VOLTA PRA 0 :\
Poderiгo me Ajudar?
OnPlayerConnect
OnPlayerDisconnect
Poderiгo me Ajudar?
OnPlayerConnect
Код:
public OnPlayerConnect(playerid) { PreloadAnimLib(playerid,"BOMBER"); PreloadAnimLib(playerid,"RAPPING"); PreloadAnimLib(playerid,"SHOP"); PreloadAnimLib(playerid,"BEACH"); PreloadAnimLib(playerid,"SMOKING"); PreloadAnimLib(playerid,"FOOD"); PreloadAnimLib(playerid,"ON_LOOKERS"); PreloadAnimLib(playerid,"DEALER"); PreloadAnimLib(playerid,"CRACK"); PreloadAnimLib(playerid,"CARRY"); PreloadAnimLib(playerid,"COP_AMBIENT"); PreloadAnimLib(playerid,"PARK"); PreloadAnimLib(playerid,"INT_HOUSE"); PreloadAnimLib(playerid,"FOOD"); PreloadAnimLib(playerid,"PED"); //so the timer can be executed again PlayerInfo[playerid][SpawnDance] = true; roubo[playerid] = 0; Peixes[playerid] = 0; new sstring[256]; new aname[MAX_PLAYER_NAME]; GetPlayerName(playerid, aname, MAX_PLAYER_NAME); format(file, sizeof(file), PASTA_CONTAS, aname); new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); if(strfind(name,"bot",true) != -1 || strfind(name,"[BOT]",true) != -1 || strfind(name,"com",true) != -1 || strfind(name,"aux",true) != -1 || strfind(name,"prn",true) != -1) { new string[256]; SendClientMessage(playerid, Vermelho, "* Vocк foi banido! Motivo: Nick proнbido!"); format(string, sizeof(string), "* |ADMBOT| baniu o jogador %s (Motivo: Nick proнbido)" ,PlayerName(playerid)); SendClientMessageToAll(tcadm, string); dini_IntSet("banidos.ini",name,1); SetPlayerPos(playerid, 831.9581,-1102.1510,24.2969); GameTextForPlayer(playerid,"~r~Banido~w~!", 2500, 3); Kick(playerid); return 1; } TextDrawShowForPlayer(playerid, topblack); TextDrawShowForPlayer(playerid, bottomblack); if(dini_Int("nickban.ini",aname) == 1){ SendClientMessage(playerid, Vermelho, "* Vocк foi banido: Nick banido!"); format(sstring, sizeof(sstring), "* |ADMBOT| baniu o jogador %s (Motivo: Nick banido) ", aname); SendClientMessageToAll(tcadm, sstring); SetPlayerPos(playerid, 831.9581,-1102.1510,24.2969); GameTextForPlayer(playerid,"~r~banido~w~!", 2500, 3); Kick(playerid); return 1; } if(dini_Int("banidos.ini",aname) == 1){ SendClientMessage(playerid, Vermelho, "* Vocк foi banido: Conta banida!"); format(sstring, sizeof(sstring), "* |ADMBOT| baniu o jogador %s (%d) (Motivo: Conta banida)", aname,playerid); SendClientMessageToAll(tcadm, sstring); SetPlayerPos(playerid, 831.9581,-1102.1510,24.2969); GameTextForPlayer(playerid,"~r~banido~w~!", 2500, 3); Kick(playerid); return 1; } SetPlayerColor(playerid,0x3B3B3BAA); SetPlayerHealth(playerid,30.0); ResetPlayerGrana(playerid); dini_IntSet(file, "DM", 0); AFK[playerid]=0; multar[playerid]= 0; autoescola[playerid] = 0; nogame[playerid] = 0; noevento[playerid] = 0; PlayerInfo[playerid][Logged] = 0; vip[playerid] = 0; DMLiberado[playerid] = 0; Mute[playerid] = 0; pAdmin[playerid] = 0; new Pname[MAX_PLAYER_NAME]; new string[256]; GetPlayerName(playerid, Pname, sizeof(Pname)); format(string, sizeof(string), "» %s (%d) entrou no server.", Pname,playerid); SendClientMessageToAll(0xFFFFFFAA,string); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); SendClientMessage(playerid, 0xFFFFFFAA, " "); ApplyAnimation(playerid,"COP_AMBIENT","Coplook_in",4.1,0,1,1,1,1); SendClientMessage(playerid, 0xC0FF3EAA, "•~~~~~~~~~~~~~~~~~~~~~~~~ Bem vindo(a)! ~~~~~~~~~~~~~~~~~~~~~~~~•"); SendClientMessage(playerid, 0xD9FFD0AA, "» Tenha Um Bom Jogo. NomeDoSeuServer"); //format(string, sizeof(string), "» %s (%d) entrou no server, » NomeDoSeuServer", Pname,playerid); //SendClientMessageToAll(0xD9FFD0AA,string); SendClientMessage(playerid, 0x00B8AEAA, "» veja os creditos do nosso (RPG)NomeDoSeuServer™ '/creditos::."); SendClientMessage(playerid, 0xD9FFD0AA, "» Aqui prezamos o bem estar dos nossos jogadores, obrigado e volte sempre::."); SendClientMessage(playerid, 0x00B8AEAA, "» Se precisar de ajuda e nгo tem admin OnLine digite /ajuda::."); SendClientMessage(playerid, 0xD9FFD0AA, "» Obrigado por jogar em nosso servidor::."); SendClientMessage(playerid, 0xC0FF3EAA, "•~~~~~~~~~~~~~~~~~~~~~~~~ Bem vindo(a)! ~~~~~~~~~~~~~~~~~~~~~~~~•"); SetSpawnInfo(playerid, 0, dini_Int(file, "Skin"), dini_Int(file, "CasaX"), dini_Int(file, "CasaY"), dini_Int(file, "CasaZ"), 354.1657, 0, 0, 0, 0, 0, 0); SetPlayerMapIcon(playerid, 1, 1774.4642,-1661.1417,14.4284, 35, 0); SetPlayerMapIcon(playerid, 2, -212.8613,1119.1418,29.3266, 35, 0); SetPlayerMapIcon(playerid, 3, -1494.0314,919.8314,7.1875, 35, 0); SetPlayerMapIcon(playerid, 4, 1243.8890,-1692.5259,16.1994, 38, 0); SetPlayerMapIcon(playerid, 5, -89.6306,1227.6676,19.7422, 38, 0); SetPlayerMapIcon(playerid, 6, 1046.2512,1016.4595,11.0000, 38, 0); SetPlayerMapIcon(playerid, 7, 1720.0509,-1740.4540,13.5469, 52, 0); SetPlayerMapIcon(playerid, 8, 512.2222,-1510.8358,14.5661, 52, 0); SetPlayerMapIcon(playerid, 9, 1412.1920,-1700.1478,13.5395, 52, 0); SetPlayerMapIcon(playerid, 10, 0000.0000,0000.0000,0000.0000, 52, 0);//vago banco SetPlayerMapIcon(playerid, 11, 0000.0000,0000.0000,0000.0000, 52, 0);//vago banco SetPlayerMapIcon(playerid, 12, 0000.0000,0000.0000,0000.0000, 52, 0);//vago banco SetPlayerMapIcon(playerid, 13, 0000.0000,0000.0000,0000.0000, 52, 0);//vago banco SetPlayerMapIcon(playerid, 14, 0000.0000,0000.0000,0000.0000, 52, 0);//vago banco SetPlayerMapIcon(playerid, 15, 2244.9500,-1665.3444,15.4690, 45, 0); SetPlayerMapIcon(playerid, 16, 1295.3374,-1422.9745,14.9596, 12, 0); SetPlayerMapIcon(playerid, 17, 1162.7776,-1694.1653,14.1719, 49, 0); SetPlayerMapIcon(playerid, 18, 11622.8165,-1895.3059,13.2562, 55, 0); SetPlayerMapIcon(playerid, 19, 383.2046,-2282.5002,16.6997, 9, 0); SetPlayerMapIcon(playerid, 20, 2450.4443,-2594.1235,13.5415, 51, 0); SetPlayerMapIcon(playerid, 21, 15.0523,-2649.1311,40.3327, 44, 0); SetPlayerMapIcon(playerid, 22, 1941.2397,-1775.9082,13.6406, 55, 0); SetPlayerMapIcon(playerid, 23, 1002.7216,-936.4431,41.9984, 55, 0); SetPlayerMapIcon(playerid, 24, -87.8931,-1172.4600,3.4090, 55, 0); SetPlayerMapIcon(playerid, 25, 1382.4894,462.6556,20.1216, 55, 0); SetPlayerMapIcon(playerid, 26, -1578.1204,-2736.5315,51.5871, 55, 0); SetPlayerMapIcon(playerid, 27, -2244.2646,-2559.2173,35.5037, 55, 0); SetPlayerMapIcon(playerid, 28, 67.8376,1219.7317,23.1115, 55, 0); SetPlayerMapIcon(playerid, 29, -1310.5292,2692.7874,64.5055, 55, 0); SetPlayerMapIcon(playerid, 30, 1588.0338,2204.2349,13.6305, 55, 0); SetPlayerMapIcon(playerid, 31, 2147.1826,2748.3552,12.2513, 55, 0); SetPlayerMapIcon(playerid, 32, 2201.9485,2475.2620,12.1006, 55, 0); SetPlayerMapIcon(playerid, 33, 2112.7839,919.2229,12.5152, 55, 0); SetPlayerMapIcon(playerid, 34, 2633.8906,1105.4639,14.5109, 55, 0); SetPlayerMapIcon(playerid, 35, -1471.1584,1864.1981,34.0461, 55, 0); SetPlayerMapIcon(playerid, 36, -2413.0642,978.4183,47.3375, 55, 0); SetPlayerMapIcon(playerid, 37, -1678.2310,409.3163,10.7286, 55, 0); SetPlayerMapIcon(playerid, 38, 1555.4916,-1675.6893,16.1953, 30, 0); SetPlayerMapIcon(playerid, 39, 153.7852,-1760.4120,4.7779, 43, 0); TextDrawShowForPlayer(playerid, Ntick); return 1; }
Код:
public OnPlayerDisconnect(playerid, reason) { KillTimer( PlayerInfo[playerid][SpawnTimer] ); new aname[MAX_PLAYER_NAME]; GetPlayerName(playerid, aname, MAX_PLAYER_NAME); format(file, sizeof(file), PASTA_CONTAS, aname); dini_IntSet(file, "Admin", pAdmin[playerid]); new Pname[MAX_PLAYER_NAME]; new string[256]; GetPlayerName(playerid, Pname, sizeof(Pname)); switch(reason) { case 0: format(string, sizeof(string), "» %s (%d) saiu do server ( Internet da xuxa ).", Pname,playerid); case 1: format(string, sizeof(string), "» %s (%d) saiu do server ( Vontade prуpria ).", Pname,playerid); case 2: format(string, sizeof(string), "» %s (%d) saiu do server ( Kickado / Banido ).", Pname,playerid); } Mute[playerid] = 0; SendClientMessageToAll(0xA6A6A6AA, string); TextDrawHideForPlayer(playerid, Relogio); new Interior; Interior = GetPlayerInterior(playerid); new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z); new grana; grana = GetPlayerGrana(playerid); dini_IntSet(file, "Dinheiro", grana); dini_IntSet(file,"Continuar",1); dini_FloatSet(file,"ContinuarX",Float:X); dini_FloatSet(file,"ContinuarY",Float:Y); dini_FloatSet(file,"ContinuarZ",Float:Z); dini_IntSet(file,"ContinuarI",Interior); dini_IntSet(file, "convitent", 0); dini_IntSet(file, "Entrevista", 0); dini_IntSet(file,"aAdmin",0); dini_IntSet(file,"Admin",0); if(pAdmin[playerid] == 1 || pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5) { new AdminName[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); format(string, sizeof(string), "~w~%s: ~b~ADM ~r~OFFLINE", AdminName); for(new i=0; i<MAX_PLAYERS; i++) { GameTextForPlayer(i, string , 5000, 3); } } if(InCall[playerid]==1) { if(playerid==sender) { InCall[gc]=0,GetCall[gc]=0; InCall[sender]=0,GetCall[sender]=0; SetPlayerSpecialAction(gc,SPECIAL_ACTION_STOPUSECELLPHONE); format(str3,128,"%s saiu do servidor e a chamada desligou automaticamente!",GetName(sender)); SendClientMessage(gc,GRAY,str3); } else if(playerid == gc) { InCall[gc]=0,GetCall[gc]=0; InCall[sender]=0,GetCall[sender]=0; SetPlayerSpecialAction(sender,SPECIAL_ACTION_STOPUSECELLPHONE); format(str3,128,"%s saiu do servidor e a chamada desligou automaticamente!",GetName(gc)); SendClientMessage(sender,GRAY,str3); } } minutos[playerid] = 0; Conversa[playerid] = 0; NaFaculdade[playerid] = 0; TextDrawHideForPlayer(playerid, Ntick); return 1; }