11.03.2012, 13:38
Hello,i hosted a server and i wanted to put my gamemode in it.When im in localhost the server does work but when i put it in my hosted server and login,it will crash,nothing on log just game mode has exited or something like that...
so can someone give me advice?
heres the dialog_login
onplayerspawn
so can someone give me advice?
heres the dialog_login
Код:
case DIALOG_LOGIN: { if ( !response ) return Kick ( playerid ); if( response ) { if(udb_hash(inputtext) == PlayerInfo[playerid][pPass]) { INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); new tmp2[ 256 ], playername2[ MAX_PLAYER_NAME ] ; SetSpawnInfo(playerid,0,PlayerInfo[playerid][pSkin],PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z],1.0,0,0,0,0,0,0); SpawnPlayer(playerid); SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]); SetPlayerInterior(playerid,PlayerInfo[playerid][pInt]); TextDrawHideForPlayer(playerid,lbt); TextDrawHideForPlayer(playerid,lbb); ResetMoneyBar(playerid);//Resets the money in the original moneybar, Do not remove! UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);//Sets the money in the moneybar to the serverside cash, Do not remove! GetPlayerName(playerid, playername2, sizeof(playername2)); format(tmp2, sizeof(tmp2), "~w~Welcome ~n~~g~%s", playername2); GameTextForPlayer(playerid, tmp2, 5000, 1); SetTimerEx("UnsetFirstSpawn", 5000, false, "i", playerid); VipDiscount[playerid] = PlayerInfo[playerid][pVip] * 50; StopAudioStreamForPlayer(playerid); PreloadAnimLib(playerid,"BENCHPRESS"); 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,"CRACK"); TextDrawShowForPlayer(playerid, Clock); } else { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit"); } } return 1; }
Код:
public OnPlayerSpawn(playerid) { if(IsPlayerConnected(playerid)) { SetPlayerFightingStyle (playerid, PlayerInfo[playerid][pFightingStyle]); SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); if(PlayerInfo[playerid][pTutorial] == 1) { new string2[512]; tutorialstage[playerid] = 1; SetPlayerHealth(playerid,100); SetPlayerPos(playerid,-2000.9891,114.5674,36.8061); SetPlayerCameraPos(playerid,-2000.9891,114.5674,34.8061);//trainstation SetPlayerCameraLookAt(playerid,-1983.2843,137.8904,27.6875); format(string2,sizeof(string2),"This is the train station,your first spawn place."); TextDrawSetString(Textdraw98[playerid],string2); TextDrawShowForPlayer(playerid,Textdraw98[playerid]); TextDrawShowForPlayer(playerid,Textdraw97[playerid]); TogglePlayerControllable(playerid,0); SetPlayerVirtualWorld(playerid,3); } if(IsPlayerNPC(playerid)) { SetPlayerSkin(playerid,113); SetPlayerPos(playerid,1416.1754,-6.8161,1000.9261); SetPlayerInterior(playerid,1); } if(FirstSpawn[playerid] == 1) { SetPlayerPos(playerid, -1961.9011,138.1674,27.6940); } if(Hospitalized[playerid] == 1) { SetPlayerToTeamColor(playerid); TogglePlayerControllable(playerid,false); SetPlayerHealth(playerid,1.0); SetPlayerPos(playerid,-2635.5378,648.4147,52.285); TogglePlayerControllable(playerid, 0); IsDead[playerid] = 0; new RandomWeth; RandomWeth = random(2); switch(RandomWeth) { case 0: { SetPlayerVirtualWorld(playerid,1); } case 1: { SetPlayerVirtualWorld(playerid,2); } } GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~You need to rest now, please wait",8000,3); SetTimerEx("AfterSpawnHos", 10000, false, "i", playerid); ApplyAnimationEx(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); } if(PlayerInfo[playerid][pPos_x] == 0 && PlayerInfo[playerid][pPos_y] == 0) { SetPlayerPos(playerid, -1961.9011,138.1674,27.6940); } else { SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]); } } /* for(new i = 0; i < sizeof(RacketInfo); i++) { GangZoneShowForPlayer(playerid,Gangzones, RacketInfo[i][rTurfcolor]); } if(ZoneAttacker[t] != -1) GangZoneFlashForPlayer(playerid, ZoneID[t], OrgInfo[ZoneAttacker][Color])); }*/ return 1; }