01.06.2016, 22:36
Tнtulo, cuando se termina de registrar y hace spawn muere el personaje, y no tiene sentido ya que le estoy estableciendo a la cuenta y al jugador 100 de vida, acб el cуdigo cuando termina el tutorial.
їQuieren saber que tengo en OnPlayerSpawn?
Код:
DestroyTextDrawTutorial(playerid), TogglePlayerSpectating(playerid, false); SetSpawnInfo(playerid, 0, Info[playerid][pChar], 1743.2155, -1862.1309, 13.5767, 269.15, 0, 0, 0, 0, 0, 0); for(new p = 0; p < 4; p++){TextDrawHideForPlayer(playerid, TutTxt[p]);} gOoc[playerid] = 0, gNews[playerid] = 0, gFam[playerid] = 0, TutStep[playerid] = 0; gNewbie[playerid] = 0, Muted[playerid] = 0, TutTime[playerid] = 0, HungryCheck(playerid, 50.0); ShowProgressBarForPlayer(playerid, HungryBar[playerid]); SendClientMessageEx(playerid, COLOR_GENERAL, "Bienvenido! {FFFFFF}Si tienes alguna inquietud o duda, usa nuestro canal de ayuda, /duda [Pregunta]."); SendClientMessageEx(playerid, -1, "Puedes reportar cualquier tema con el comando /reportar [ID] [Razуn] y nuestro soporte te ayudarб."); SendClientMessageEx(playerid, COLOR_GENERAL, "TIP: {FFFFFF}Tienes una restricciуn de usar armas de 2 horas."); SendClientMessageEx(playerid, COLOR_GENERAL, "TIP: {FFFFFF}La barra de color verde es el porcentaje de hambre que tienes."); Info[playerid][pWRestricted] = 1, Info[playerid][pTut] = 1; Info[playerid][pTimePayDay] = 0, Info[playerid][pLevel] = 1; Info[playerid][pHealth] = 100.0, gPlayerLogged[playerid] = 1; TogglePlayerControllable(playerid, 1), SetPlayerVirtualWorld(playerid, 0), ClearAnimations(playerid); SetCameraBehindPlayer(playerid), GivePlayerCash(playerid, 5000), SetPlayerHealth(playerid, 100); TextDrawShowForPlayer(playerid, ZenonCity[0]), TextDrawShowForPlayer(playerid, ZenonCity[1]); TextDrawShowForPlayer(playerid, ZenonCity[2]); TotalLogin ++, gPlayerLogged{playerid} = 1; OnPlayerSavedStats(playerid), SpawnPlayer(playerid);
Код:
public OnPlayerSpawn(playerid) { if(!IsPlayerConnectedEx(playerid)) { SendClientMessageEx(playerid, COLOR_GENERAL, "Aviso:"COL_WHITE"Fuiste expulsado automбticamente, no has ingresado correctamente."); Expulsar(playerid); return 1; } if(IsPlayerNPC(playerid)) return 1; if(!gPlayerAnimLibsPreloaded[playerid]) { LoadAnimLibs(playerid); gPlayerAnimLibsPreloaded[playerid] = 1; } CancelSelectTextDraw(playerid); SetPlayerWantedLevel(playerid, Info[playerid][pWantedLevel]); SetPlayerSpawn(playerid); SetPlayerWeapons(playerid); OnDuty[playerid] = 0; SetPlayerToTeamColor(playerid); SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1); SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1); SyncPlayerTime(playerid); HungryCheck(playerid, Info[playerid][pHungry]); SetPVarInt(playerid,"Dandoarma",0); return 1; }