04.01.2014, 03:29
Hola, anuncio que mi server sufre un lag masivo de repente, se que me dirбn: " Optimiza ", pues tenнa el GM en strcmp y lo pasй todo a ZCMD, Usaba dini, pero lo cambie a y_ini, uso Foreach para llamar a todos los jugadores etc, no tengo sobrecargado OnPlayerUpdate, No uso muchos timerґs individuales y tengo pocos timers globales.., їquй podrб ser?, de todas formas dejo acб el public OnPlayerUpdate y los timers.
Йstos son los timers y sus funciones:
Auxilio he intentado de todo pero no encuentro el problema!, йstos son los includes que uso:
Код:
public OnPlayerUpdate(playerid) { new Float:animX, Float:animY, Float:animZ; new anim = GetPlayerAnimationIndex(playerid); GetPlayerPos(playerid, animX, animY, animZ); if((anim >= 1538) && (anim <= 1542) && animZ > 5) { M(playerid, red, "SERVER: Posible cheat de AirBreak, kickeado por seguridad."); Kick(playerid); } new Float:Pos_x,Float:Pos_y,Float:Pos_z; GetPlayerVelocity(playerid,Pos_x,Pos_y,Pos_z); if(Pos_x <= -0.800000 || Pos_y <= -0.800000 || Pos_z <= -0.800000) { M(playerid, red, "SERVER: Posible cheat de AirBreak, kickeado por seguridad."); Kick(playerid); } if(IsPlayerInAnyVehicle(playerid)) { new engine,lights,alarm,doors,bonnet,boot,objective; new veh = GetPlayerVehicleID(playerid); GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective); if(Fuel[veh] <= 15 && GetPVarInt(playerid, "CheckAvis") == 0) { GameTextForPlayer(playerid, "Queda poca gasolina, busca una estaciуn.", 3000, 3); SetPlayerCheckpoint(playerid, 1938.0389,-1773.1208,13.0801, 5.0); SetPVarInt(playerid, "CheckAvis", 1); } if(Fuel[veh] < 1) { SetPlayerCheckpoint(playerid, 1938.0389,-1773.1208,13.0801, 5.0); if(GetPVarInt(playerid, "CheckAvised2") == 0) { GameTextForPlayer(playerid, "Vehiculo sin gasolina", 3000, 3); SetPVarInt(playerid, "CheckAvised2", 1); } SetPVarInt(playerid, "CheckOn", 1); SetVehicleParamsEx(veh,0,lights,alarm,doors,bonnet,boot,objective); } new string1[5]; new vspeed = GetVehicleSpeed(GetPlayerVehicleID(playerid)); format(string1, sizeof(string1), "%d", vspeed); TextDrawSetString(Textdraw2V[playerid], string1); new string2[5]; new Gasoil = Fuel[GetPlayerVehicleID(playerid)]; format(string2, sizeof(string2), "%d", Gasoil); // /100 ... TextDrawSetString(Textdraw5V[playerid], string2); new string3[5]; new Float:hpcar; GetVehicleHealth(GetPlayerVehicleID(playerid), hpcar); format(string3, sizeof(string3), "%f", hpcar); TextDrawSetString(Textdraw8V[playerid], string3); if(cochesito[GetPlayerVehicleID(playerid)] == 0) { if(hpcar <= 400.0) { format(strinx, sizeof(strinx), "* %s [ El coche se ha roto. ]", NombreJugador(playerid)); ProxDetector(20.0, playerid, strinx, Amarillo, Amarillo, Amarillo, Amarillo, Amarillo); GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(GetPlayerVehicleID(playerid),0,lights,alarm,doors,bonnet,boot,objective); cochesito[GetPlayerVehicleID(playerid)] = 1; SetVehicleHealth(GetPlayerVehicleID(playerid), 400.0); cochesito[GetPlayerVehicleID(playerid)] = 1; } } } new Float:HP; GetPlayerHealth(playerid, HP); if(HP >= VidaUsuario[playerid]) { return 1; } else { VidaPlayer(playerid, HP); } new Float:Chaleco; GetPlayerArmour(playerid, Chaleco); if(Chaleco >= ChalecoUsuario[playerid]) { return 1; } else { ChalecoPlayer(playerid, Chaleco); } return 1; }
Код:
public OnGameModeInit() { SetTimer("ExpHour",60000,true); SetTimer("VerCansancio", 50000, true); SetTimer("AntiCheat", 1000, true); SetTimer("TimerInfeccion", 1000, true); SetTimer("rere",100,true); SetTimer("UnaVez", 5000, false); return 1; } public ExpHour() { new hour,minuto,second; gettime(hour,minuto,second); format(strinx, sizeof(strinx), "SERVER: Son las %d:%d0", hour, minuto); { foreach(Player, i) { minsEXP[i]++; if(minuto == 0) { if(minsEXP[i] >= 5 && Spawn[i] == 1) { PlayerInfo[i][jExperiencia] += 1; PlayerPlaySound(i, 1187, 0.0, 0.0, 0.0); SetTimer("fuerasound",7000,false); PlayerInfo[i][jObjeto1] = 0; PlayerInfo[i][jObjeto18] = 0; PlayerInfo[i][jObjeto35] = 0; PlayerInfo[i][jObjeto52] = 0; PlayerInfo[i][jObjeto2] = 0; PlayerInfo[i][jObjeto19] = 0; PlayerInfo[i][jObjeto36] = 0; PlayerInfo[i][jObjeto53] = 0; PlayerInfo[i][jObjeto3] = 0; PlayerInfo[i][jObjeto20] = 0; PlayerInfo[i][jObjeto37] = 0; PlayerInfo[i][jObjeto54] = 0; PlayerInfo[i][jObjeto4] = 0; PlayerInfo[i][jObjeto21] = 0; PlayerInfo[i][jObjeto38] = 0; PlayerInfo[i][jObjeto55] = 0; PlayerInfo[i][jObjeto5] = 0; PlayerInfo[i][jObjeto22] = 0; PlayerInfo[i][jObjeto39] = 0; PlayerInfo[i][jObjeto56] = 0; PlayerInfo[i][jObjeto6] = 0; PlayerInfo[i][jObjeto23] = 0; PlayerInfo[i][jObjeto40] = 0; PlayerInfo[i][jObjeto57] = 0; PlayerInfo[i][jObjeto7] = 0; PlayerInfo[i][jObjeto24] = 0; PlayerInfo[i][jObjeto41] = 0; PlayerInfo[i][jObjeto58] = 0; PlayerInfo[i][jObjeto8] = 0; PlayerInfo[i][jObjeto25] = 0; PlayerInfo[i][jObjeto42] = 0; PlayerInfo[i][jObjeto59] = 0; PlayerInfo[i][jObjeto9] = 0; PlayerInfo[i][jObjeto26] = 0; PlayerInfo[i][jObjeto43] = 0; PlayerInfo[i][jObjeto60] = 0; PlayerInfo[i][jObjeto10] = 0; PlayerInfo[i][jObjeto27] = 0; PlayerInfo[i][jObjeto44] = 0; PlayerInfo[i][jObjeto61] = 0; PlayerInfo[i][jObjeto11] = 0; PlayerInfo[i][jObjeto28] = 0; PlayerInfo[i][jObjeto45] = 0; PlayerInfo[i][jObjeto62] = 0; PlayerInfo[i][jObjeto12] = 0; PlayerInfo[i][jObjeto29] = 0; PlayerInfo[i][jObjeto46] = 0; PlayerInfo[i][jObjeto63] = 0; PlayerInfo[i][jObjeto13] = 0; PlayerInfo[i][jObjeto30] = 0; PlayerInfo[i][jObjeto47] = 0; PlayerInfo[i][jObjeto64] = 0; PlayerInfo[i][jObjeto14] = 0; PlayerInfo[i][jObjeto31] = 0; PlayerInfo[i][jObjeto48] = 0; PlayerInfo[i][jObjeto65] = 0; PlayerInfo[i][jObjeto15] = 0; PlayerInfo[i][jObjeto32] = 0; PlayerInfo[i][jObjeto49] = 0; PlayerInfo[i][jObjeto66] = 0; PlayerInfo[i][jObjeto16] = 0; PlayerInfo[i][jObjeto33] = 0; PlayerInfo[i][jObjeto50] = 0; PlayerInfo[i][jObjeto67] = 0; PlayerInfo[i][jObjeto17] = 0; PlayerInfo[i][jObjeto34] = 0; PlayerInfo[i][jObjeto51] = 0; PlayerInfo[i][jObjeto68] = 0; PlayerInfo[i][jObjeto69] = 0; PlayerInfo[i][jObjeto75] = 0; PlayerInfo[i][jObjeto81] = 0; PlayerInfo[i][jObjeto87] = 0; PlayerInfo[i][jObjeto70] = 0; PlayerInfo[i][jObjeto76] = 0; PlayerInfo[i][jObjeto82] = 0; PlayerInfo[i][jObjeto88] = 0; PlayerInfo[i][jObjeto71] = 0; PlayerInfo[i][jObjeto77] = 0; PlayerInfo[i][jObjeto83] = 0; PlayerInfo[i][jObjeto89] = 0; PlayerInfo[i][jObjeto72] = 0; PlayerInfo[i][jObjeto78] = 0; PlayerInfo[i][jObjeto84] = 0; PlayerInfo[i][jObjeto90] = 0; PlayerInfo[i][jObjeto73] = 0; PlayerInfo[i][jObjeto79] = 0; PlayerInfo[i][jObjeto85] = 0; PlayerInfo[i][jObjeto91] = 0; PlayerInfo[i][jObjeto74] = 0; PlayerInfo[i][jObjeto80] = 0; PlayerInfo[i][jObjeto86] = 0; PlayerInfo[i][jObjeto92] = 0; PlayerInfo[i][jObjeto93] = 0; PlayerInfo[i][jObjeto96] = 0; PlayerInfo[i][jObjeto99] = 0; PlayerInfo[i][jObjeto102] = 0; PlayerInfo[i][jObjeto94] = 0; PlayerInfo[i][jObjeto97] = 0; PlayerInfo[i][jObjeto100] = 0; PlayerInfo[i][jObjeto103] = 0; PlayerInfo[i][jObjeto95] = 0; PlayerInfo[i][jObjeto98] = 0; PlayerInfo[i][jObjeto101] = 0; PlayerInfo[i][jObjeto104] = 0; PlayerInfo[i][jObjeto105] = 0; PlayerInfo[i][jObjeto106] = 0; PlayerInfo[i][jObjeto107] = 0; ComprobarLabel(i); SetWorldTime(hour); SetPlayerTime(i, hour, minuto); new ran = random(10); switch (ran) { case 0:{SetWeather(0);} case 1:{SetWeather(1);} case 2:{SetWeather(2);} case 3:{SetWeather(3);} case 4:{SetWeather(4);} case 5:{SetWeather(5);} case 6:{SetWeather(6);} case 7:{SetWeather(7);} case 8:{SetWeather(8);} case 9:{SetWeather(9);} } SendClientMessage(i, C_Blanco," "); SendClientMessage(i, C_Blanco," "); SendClientMessage(i, C_Blanco," "); SendClientMessage(i, C_Blanco," "); SendClientMessage(i, C_Blanco," "); SendClientMessage(i, C_Blanco," "); SendClientMessage(i, -1,strinx); SendClientMessage(i, C_Blanco,":__________________________________:"); SendClientMessage(i, COLOR_VERDE_CLARO," (-- ExpHour --) "); SendClientMessage(i, COLOR_AMARILLO,""); SendClientMessage(i, Amarillo," Experiencia [+1]"); if(PlayerInfo[i][jHabMecanico] >= 1) { if(PlayerInfo[i][jHabMecanico] >= 10) { SendClientMessage(i, Amarillo," Hab. Mecбnico [0]"); SendClientMessage(i, Amarillo," Puntos de bъsqueda reestablecidos."); SendClientMessage(i, COLOR_AMARILLO,""); SendClientMessage(i, C_Blanco,":__________________________________:"); PlayerInfo[i][jUsoHabMecanico] = 0; PlayerInfo[i][jHabMecanico] = 10; break; } else if(PlayerInfo[i][jUsoHabMecanico] >= 2) { SendClientMessage(i, Amarillo," Hab. Mecбnico [+1]"); PlayerInfo[i][jHabMecanico] += 1; } else if(PlayerInfo[i][jUsoHabMecanico] <= 2) { if(PlayerInfo[i][jHabMecanico] >= 2) { SendClientMessage(i, Amarillo," Hab. Mecбnico [-1]"); PlayerInfo[i][jHabMecanico] -= 1; } } else if(PlayerInfo[i][jUsoHabMecanico] <= 2) { if(PlayerInfo[i][jHabMecanico] >= 1) { SendClientMessage(i, Amarillo," Hab. Mecбnico [0]"); } } } if(PlayerInfo[i][jHabLadron] >= 1) { if(PlayerInfo[i][jHabLadron] >= 10) { SendClientMessage(i, Amarillo," Hab. Ladrуn [0]"); SendClientMessage(i, Amarillo," Puntos de bъsqueda reestablecidos."); SendClientMessage(i, COLOR_AMARILLO,""); SendClientMessage(i, C_Blanco,":__________________________________:"); PlayerInfo[i][jUsoHabLadron] = 0; PlayerInfo[i][jHabLadron] = 10; break; } if(PlayerInfo[i][jUsoHabLadron] >= 2) { SendClientMessage(i, Amarillo," Hab. Ladrуn [+1]"); PlayerInfo[i][jHabLadron] += 1; } if(PlayerInfo[i][jUsoHabLadron] <= 2) { if(PlayerInfo[i][jHabLadron] >= 2) { SendClientMessage(i, Amarillo," Hab. Ladrуn [-1]"); PlayerInfo[i][jHabLadron] -= 1; } } if(PlayerInfo[i][jUsoHabLadron] <= 2) { if(PlayerInfo[i][jHabLadron] >= 1) { SendClientMessage(i, Amarillo," Hab. Ladrуn [0]"); } } } if(PlayerInfo[i][jHabPunteria] >= 1) { if(PlayerInfo[i][jHabPunteria] >= 10) { SendClientMessage(i, Amarillo," Hab. Punterнa [0]"); SendClientMessage(i, Amarillo," Puntos de bъsqueda reestablecidos."); SendClientMessage(i, COLOR_AMARILLO,""); SendClientMessage(i, C_Blanco,":__________________________________:"); PlayerInfo[i][jUsoHabPunteria] = 0; PlayerInfo[i][jHabPunteria] = 10; break; } if(PlayerInfo[i][jUsoHabPunteria] >= 2) { SendClientMessage(i, Amarillo," Hab. Punterнa [+1]"); PlayerInfo[i][jHabPunteria] += 1; } if(PlayerInfo[i][jUsoHabPunteria] <= 2) { if(PlayerInfo[i][jHabPunteria] >= 2) { SendClientMessage(i, Amarillo," Hab. Punterнa [-1]"); PlayerInfo[i][jHabPunteria] -= 1; } } if(PlayerInfo[i][jUsoHabPunteria] <= 2) { if(PlayerInfo[i][jHabPunteria] >= 1) { SendClientMessage(i, Amarillo," Hab. Punterнa [0]"); } } } SendClientMessage(i, Amarillo," Puntos de bъsqueda reestablecidos."); SendClientMessage(i, C_Blanco,":__________________________________:"); } else M(i,COLOR_NARANJA,"No recibistes el ExpHour; no tienes ni 5 minutos jugando."); } } } return 1; } public VerCansancio() { for(new v = 0; v < MAX_VEHICLES; v++) { new engine,lights,alarm,doors,bonnet,boot,objective; GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective); if(engine && Fuel[v] > 0) { Fuel[v]--; } } foreach(Player, i) { if(Spawn[i] == 1) { if(PlayerInfo[i][jFaccion] != Zombie && !IsPlayerNPC(i) && entuto[i] == 0) { if(PlayerInfo[i][jCansancio] == 0.0) { if(EstaCansado2[i] == 0.0) { M(i,COLOR_ROJO,"Has pasado mucho tiempo despierto, y ahora estбs agotado, mejor ve a dormir."); TextDrawShowForPlayer(i, Cansadot[i]); TextDrawShowForPlayer(i, Textdraw0m[i]); TextDrawShowForPlayer(i, Textdraw1m[i]); TextDrawShowForPlayer(i, Textdraw2m[i]); TextDrawShowForPlayer(i, Textdraw3m[i]); TextDrawShowForPlayer(i, Textdraw4m[i]); TextDrawShowForPlayer(i, TimerInfecc[i]); TextDrawShowForPlayer(i, Textdraw6m[i]); SetPlayerDrunkLevel(i, 1800000); TextDrawShowForPlayer(i, Barra1[i]); TextDrawShowForPlayer(i, Barra2[i]); TextDrawShowForPlayer(i, Barra3[i]); TextDrawShowForPlayer(i, Barra4[i]); EstaCansado2[i] = 1; return 1; } } PlayerInfo[i][jCansancio] -= 1.0; if(PlayerInfo[i][jCansancio] >= 20.0 && PlayerInfo[i][jCansancio] <= 50.0) { if(EstaCansado[i] == 0) { M(i,COLOR_AMARILLO,"Ve a relajarte o a dormir, estбs un poco cansado."); EstaCansado[i] = 1; return 1; } } if(PlayerInfo[i][jCansancio] <= 20.0 && PlayerInfo[i][jCansancio] >= 1 && EstaCansado2[i] == 0.0) { M(i,COLOR_ROJO,"Has pasado mucho tiempo despierto, y ahora estбs agotado, mejor ve a dormir."); TextDrawShowForPlayer(i, Cansadot[i]); TextDrawShowForPlayer(i, Textdraw0m[i]); TextDrawShowForPlayer(i, Textdraw0m[i]); TextDrawShowForPlayer(i, Textdraw2m[i]); TextDrawShowForPlayer(i, Textdraw3m[i]); TextDrawShowForPlayer(i, Textdraw4m[i]); TextDrawShowForPlayer(i, TimerInfecc[i]); TextDrawShowForPlayer(i, Textdraw6m[i]); SetPlayerDrunkLevel(i, 1800000); TextDrawShowForPlayer(i, Barra1[i]); TextDrawShowForPlayer(i, Barra2[i]); TextDrawShowForPlayer(i, Barra3[i]); TextDrawShowForPlayer(i, Barra4[i]); EstaCansado2[i] = 1; return 1; } } } } return 1; } public AntiCheat() { foreach(Player, i) { if(!IsPlayerNPC(i) && !IsPlayerInAnyVehicle(i) || IsPlayerInAnyVehicle(i) && PlayerInfo[i][jAdminXLEP] == 0 && Spawn[i] == 1 && DisableAntiCheat[i] == 1 && entuto[i] == 0 && Muerto[i] == 0) { new Float:h, Float:a; GetPlayerHealth(i, h); GetPlayerArmour(i, a); if(h >= 101 && PlayerInfo[i][jFaccion] != Zombie) { VidaPlayer(i,100); format(strinx, sizeof(strinx), "SERVER: Posible Cheat de vida: %s.", NombreJugadorAll(i)); SendAdminMessage(red, strinx); break; } if(a >= 101 && PlayerInfo[i][jFaccion] != Zombie) { ChalecoPlayer(i,100); format(strinx, sizeof(strinx), "SERVER: Posible Cheat de Chaleco: %s.", NombreJugadorAll(i)); SendAdminMessage(red, strinx); break; } if(PlayerInfo[i][jFaccion] != Zombie) { if(GetPlayerWeapon(i) == 18 || GetPlayerWeapon(i) == 35 || GetPlayerWeapon(i) == 36 || GetPlayerWeapon(i) == 37 || GetPlayerWeapon(i) == 38 || GetPlayerWeapon(i) == 44 || GetPlayerWeapon(i) == 39) { M(i,COLOR_ROJO,"SERVER: No se permiten cheats de armas."); ResetPlayerWeapons(i); Motivos[i][4] = 1; DarAdvertencia(i); break; } } if(GetPlayerSpecialAction(i) == 2) { Motivos[i][3] = 1; DarAdvertencia(i); break; } new Float:VehicleHealth; if(IsPlayerInAnyVehicle(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER) { if(GetVehicleSpeed(i)> 230) { switch(GetVehicleModel(GetPlayerVehicleID(i))) { case 0,511,460,592,577,512,513,520,553,593,476,519: printf("[ID: %d] Manejando %d Con velocidad de %skm/h",i,GetVehicleModel(GetPlayerVehicleID(i)),GetVehicleSpeed(i)); default: { Motivos[i][8] = 1; DarAdvertencia(i); break; } } } GetVehicleHealth(GetPlayerVehicleID(i), VehicleHealth); if(VehicleHealth > 1000.0) { Motivos[i][9] = 1; DarAdvertencia(i); break; } } if(PlayerInfo[i][jFaccion] == Zombie && GetPlayerWeapon(i) >= 1) { ResetPlayerWeapons(i); } if(GetPlayerMoney(i) >= 1) { GivePlayerMoney(i, 0); Motivos[i][0] = 1; DarAdvertencia(i); } new Float:HP; GetPlayerHealth(i, HP); if(HP >= VidaUsuario[i]) { break; } else { VidaPlayer(i, HP); } new Float:armor; GetPlayerArmour(i, armor); if(armor >= ChalecoUsuario[i]) { break; } else { ChalecoPlayer(i, armor); } if(HP == VidaUsuario[i]) { } else { if(HP > VidaUsuario[i] && Spawn[i] == 1) { ReestablecerVida(i, VidaUsuario[i]); Motivos[i][1] = 1; DarAdvertencia(i); break; } } if(armor == ChalecoUsuario[i]) { } else { if(armor > ChalecoUsuario[i]) { ReestablecerChaleco(i, ChalecoUsuario[i]); Motivos[i][2] = 1; DarAdvertencia(i); break; } } } } return 1; } public TimerInfeccion() { foreach(Player, i) { if(Spawn[i] == 1) { if(PlayerInfo[i][jEnJail] == 1) { PlayerInfo[i][jJail]--; } if(PlayerInfo[i][jEnJail] == 1 && PlayerInfo[i][jJail] == 0) { tdesencarcelar(i); } if(Spawn[i] == 1 && durmiendo[i] == 0) { if(PlayerInfo[i][jControlRI] >= 0 && PlayerInfo[i][jControlRI] <= 99999) { new strm[90]; if(PlayerInfo[i][jMordidas] == 1) { PlayerInfo[i][jControlRI] -= 1; format(strm, sizeof(strm), "Infeccion: ~p~%ds", PlayerInfo[i][jControlRI]); TextDrawSetString(TimerInfecc[i], strm); } if(PlayerInfo[i][jMordidas] == 2) { PlayerInfo[i][jControlRI] -= 2; format(strm, sizeof(strm), "Infeccion: ~p~%ds", PlayerInfo[i][jControlRI]); TextDrawSetString(TimerInfecc[i], strm); } if(PlayerInfo[i][jMordidas] >= 3) { PlayerInfo[i][jControlRI] -= 3; format(strm, sizeof(strm), "Infeccion: ~p~%ds", PlayerInfo[i][jControlRI]); TextDrawSetString(TimerInfecc[i], strm); } } if(PlayerInfo[i][jControlRI] <= -1 && PlayerInfo[i][jMordidas] >= 1) { ResetPlayerWeapons(i); PlayerInfo[i][jFaccion] = Zombie; VidaPlayer(i,200); ChalecoPlayer(i,0); if(IsPlayerAttachedObjectSlotUsed(i,9)) { RemovePlayerAttachedObject(i,9); } switch(PlayerInfo[i][jFaccion]) { case Civil: { PlayerInfo[i][jMyFacc] = 0; } case FuerzaRebelde: { PlayerInfo[i][jMyFacc] = 1; } case CMA: { PlayerInfo[i][jMyFacc] = 2; } case CIH: { PlayerInfo[i][jMyFacc] = 3; } case SAEM: { PlayerInfo[i][jMyFacc] = 4; } } IdiomaH[i] = 0; IdiomaZ[i] = 1; PlayerInfo[i][jMordidas] = 0; PlayerInfo[i][jControlRI] = 1; PlayerInfo[i][jFaccion] = Zombie; KillTimer(timerx[i]); TextDrawShowForPlayer(i, Textdraw0i[i]); TextDrawShowForPlayer(i, Textdraw1i[i]); TextDrawShowForPlayer(i, Textdraw2i[i]); TextDrawShowForPlayer(i, Textdraw3i[i]); TextDrawShowForPlayer(i, Textdraw4i[i]); TextDrawShowForPlayer(i, Textdraw0m[i]); TextDrawShowForPlayer(i, Textdraw2m[i]); TextDrawHideForPlayer(i, Textdraw3m[i]); TextDrawHideForPlayer(i, Textdraw1m[i]); TextDrawShowForPlayer(i, Barra1[i]); TextDrawShowForPlayer(i, Barra2[i]); TextDrawShowForPlayer(i, Barra3[i]); TextDrawShowForPlayer(i, Barra4[i]); TextDrawHideForPlayer(i, Textdraw3m[i]); TextDrawHideForPlayer(i, Textdraw4m[i]); TextDrawHideForPlayer(i, Textdraw6m[i]); TextDrawHideForPlayer(i, Cansadot[i]); TextDrawHideForPlayer(i, Cansadito[i]); M(i, COLOR_ROJO, "El tiempo de infecciуn ya terminу, estбs infectado."); KillTimer(TVenda[i]); new ran = random(17); switch (ran) { case 0:{SetPlayerSkin(i,77);} case 1:{SetPlayerSkin(i,78);} case 2:{SetPlayerSkin(i,79);} case 3:{SetPlayerSkin(i,132);} case 4:{SetPlayerSkin(i,134);} case 5:{SetPlayerSkin(i,135);} case 6:{SetPlayerSkin(i,137);} case 7:{SetPlayerSkin(i,159);} case 8:{SetPlayerSkin(i,160);} case 9:{SetPlayerSkin(i,162);} case 10:{SetPlayerSkin(i,168);} case 11:{SetPlayerSkin(i,200);} case 12:{SetPlayerSkin(i,212);} case 13:{SetPlayerSkin(i,213);} case 14:{SetPlayerSkin(i,218);} case 15:{SetPlayerSkin(i,230);} case 16:{SetPlayerSkin(i,239);} } new strm[30]; format(strm, sizeof(strm), "Infeccion: ~p~Zombie"); TextDrawSetString(TimerInfecc[i], strm); return 1; } else { if(PlayerInfo[i][jControlRI] == 0 && PlayerInfo[i][jMordidas] == 0 && PlayerInfo[i][jFaccion] != Zombie) { new strm[30]; format(strm, sizeof(strm), "Infeccion: ~g~Sano"); TextDrawSetString(TimerInfecc[i], strm); TextDrawShowForPlayer(i, TimerInfecc[i]); } else { if(PlayerInfo[i][jFaccion] == Zombie) { new strm[22]; format(strm, sizeof(strm), "Infeccion: ~p~Zombie"); TextDrawSetString(TimerInfecc[i], strm); } } } } } } return 1; } public rere() { new Float:a, Float:h, strm[64], strv[13], strc[13], stre[16], stt[64], zone[MAX_ZONE_NAME], stringv[30]; foreach(Player, i) { if(Identificado[i] == 1 && Spawn[i] == 1) { if(durmiendo[i] == 1) { TextDrawHideForPlayer(i, Textdraw0m[i]); TextDrawHideForPlayer(i, Textdraw1m[i]); TextDrawHideForPlayer(i, Textdraw2m[i]); TextDrawHideForPlayer(i, Textdraw3m[i]); TextDrawHideForPlayer(i, Textdraw4m[i]); TextDrawHideForPlayer(i, TimerInfecc[i]); TextDrawHideForPlayer(i, Textdraw6m[i]); TextDrawHideForPlayer(i, Barra1[i]); TextDrawHideForPlayer(i, Barra2[i]); TextDrawHideForPlayer(i, Barra3[i]); TextDrawHideForPlayer(i, Barra4[i]); return 1; } else TextDrawHideForPlayer(i, Cansadito[i]); if(entuto[i] == 1) { TextDrawHideForPlayer(i, Textdraw0i[i]); TextDrawHideForPlayer(i, Textdraw1i[i]); TextDrawHideForPlayer(i, Textdraw2i[i]); TextDrawHideForPlayer(i, Textdraw3i[i]); TextDrawHideForPlayer(i, Textdraw4i[i]); TextDrawHideForPlayer(i, Textdraw0m[i]); TextDrawHideForPlayer(i, Textdraw2m[i]); TextDrawHideForPlayer(i, Textdraw3m[i]); TextDrawHideForPlayer(i, Textdraw1m[i]); TextDrawHideForPlayer(i, Textdraw3m[i]); TextDrawHideForPlayer(i, Textdraw4m[i]); TextDrawHideForPlayer(i, TimerInfecc[i]); TextDrawHideForPlayer(i, Textdraw6m[i]); TextDrawHideForPlayer(i, Cansadot[i]); TextDrawHideForPlayer(i, Cansadito[i]); TextDrawHideForPlayer(i, Barra1[i]); TextDrawHideForPlayer(i, Barra2[i]); TextDrawHideForPlayer(i, Barra3[i]); TextDrawHideForPlayer(i, Barra4[i]); return 1; } GetPlayerArmour(i, a); GetPlayerHealth(i, h); format(strm, sizeof(strm), "Arma: %s", WeaponNames[GetPlayerWeapon(i)]); format(stt, sizeof(stt), "Municion: %d", GetPlayerAmmo(i)); format(strv, sizeof(strv), "Vida: ~r~%f", h); format(strc, sizeof(strc), "Chaleco: %f", a); format(stre, sizeof(stre), "Energia: ~y~%f", PlayerInfo[i][jCansancio]); TextDrawSetString(Textdraw3m[i], strm); TextDrawSetString(Textdraw6m[i], stt); TextDrawSetString(Textdraw1m[i], strc); TextDrawSetString(Textdraw2m[i], strv); TextDrawSetString(Textdraw4m[i], stre); if(IsPlayerInAnyVehicle(i)) { Check(); TextDrawHideForPlayer(i, Zonas[i]); } else { GetPlayer2DZone(i, zone, MAX_ZONE_NAME); format(stringv,sizeof(stringv),"%s", zone); TextDrawSetString(Zonas[i], stringv); TextDrawShowForPlayer(i, Zonas[i]); } if(zoneint(i) >= 1 && zoneintt(i) >= 1) { TextDrawHideForPlayer(i, Zonas[i]); } if(a > 0) { SetPlayerAttachedObject(i, SlotObjeto, 373, 1, 0.255219, -0.012552, -0.162815, 69.963966, 27.580476, 33.800472, 0.959405, 1.000000, 1.192921 ); } else RemovePlayerAttachedObject(i,SlotObjeto); } } return 1; } public UnaVez() { for(new v = 0; v < MAX_VEHICLES; v++) { new lights,alarm,engine, doors,bonnet,boot,objective; GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(v,0,lights,alarm,doors,bonnet,boot,objective); new ran = random(8); switch (ran) { case 0:{Fuel[v] = 100;} case 1:{Fuel[v] = 90;} case 2:{Fuel[v] = 80;} case 3:{Fuel[v] = 70;} case 4:{Fuel[v] = 60;} case 5:{Fuel[v] = 50;} case 6:{Fuel[v] = 40;} case 7:{Fuel[v] = 35;} } } return 1; }
Код:
#include <a_samp> #include <foreach> #include <mSelection> #include <streamer> #include <sscanf2> #include <zcmd> #include <YSI\y_ini>