help with running a server [+rep] -
WardenCS - 11.03.2012
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
Код:
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;
}
onplayerspawn
Код:
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;
}
Re: help with running a server [+rep] -
Twisted_Insane - 11.03.2012
Make sure that you have this on the LAST line of your gamemode:
If it didn't help, this will for sure:
https://sampforum.blast.hk/showthread.php?tid=262796
Re: help with running a server [+rep] -
WardenCS - 11.03.2012
i added the crashdetect but when i checked the log it said something about OnEnterExitModShop(),but i dont even have a code like that in my gamemode...
Код:
SA-MP Dedicated Server
----------------------
v0.3d, ©2005-2011 SA-MP Team
[15:55:23] gamemode1 = "" (string)
[15:55:23] gamemode2 = "" (string)
[15:55:23] gamemode3 = "" (string)
[15:55:23] filterscripts = "" (string)
[15:55:23]
[15:55:23] Server Plugins
[15:55:23] --------------
[15:55:23] Loading plugin: streamer.so
[15:55:23]
*** Streamer Plugin v2.5.2 by Incognito loaded ***
[15:55:23] Loaded.
[15:55:23] Loading plugin: sscanf.so
[15:55:23]
[15:55:23] ===============================
[15:55:23] sscanf plugin loaded.
[15:55:23] © 2009 Alex "******" Cole
[15:55:23] 0.3d-R2 500 Players "dnee"
[15:55:23] ===============================
[15:55:23] Loaded.
[15:55:23] Loading plugin: crashdetect.so
[15:55:23] crashdetect v4.1.2 is OK.
[15:55:23] Loaded.
[15:55:23] Loaded 3 plugins.
[15:55:23]
[15:55:23] Filterscripts
[15:55:23] ---------------
[15:55:23] Loaded 0 filterscripts.
[15:55:23]
[15:55:23] =======================================
[15:55:23] | |
[15:55:23] | YSI version 1.00.0001 |
[15:55:23] | By Alex "******" Cole |
[15:55:23] | |
[15:55:23] =======================================
[15:55:23]
[15:55:23]
[15:55:23] Dynamic Houses
[15:55:23] ---------------
[15:55:23] Loaded 1 dynamic houses.
[15:55:23] vDealer: 4 vehicle(s) loaded.
[15:55:23] Number of vehicle models: 21
[15:55:35] Incoming connection: 82.131.22.164:63623
[15:55:36] [join] Luca_Salerino has joined the server (0:82.131.22.164)
[15:55:36] Luca_Salerino has picked up/attempted to spawn $0.
[15:55:36] Incoming connection: 189.72.246.235:1235
[15:55:37] [join] caca has joined the server (1:189.72.246.235)
[15:55:38] [debug] Server crashed while executing U1.amx
[15:55:38] [debug] Backtrace (most recent call first):
[15:55:38] [debug] #0 public OnEnterExitModShop()+0x8 from U1.amx
Re: help with running a server [+rep] -
Twisted_Insane - 11.03.2012
Did you add the piece of code I've on the last line?
I have no clue, what else did the plugin said? Don't look in the log of your server, look after the plugin's information...
Re: help with running a server [+rep] -
WardenCS - 11.03.2012
last lines are
Код:
main()
{
print(" ");
print(" ");
print("- Mafia Paradise GameMode Loaded -");
print(" ");
print(" Script: Luca");
}
samp.log
Код:
[Sun Mar 11 16:00:26 2012] Launching server [29909] with the following commandline:
# /home/gta227/.gameservers/samp_0/samp03svr +exec server.cfg
pid 29909's current affinity mask: ff
pid 29909's new affinity mask: ff
Started server on 80.79.113.13:7777, with maxplayers: 49 lanmode is OFF.
Game server has exited.
Re: help with running a server [+rep] -
eesh - 11.03.2012
does it crash "right"after you login? I think somethings wrong with the save files or something?
Re: help with running a server [+rep] -
WardenCS - 11.03.2012
yeah,when i log in,it will spawn me at 0.0000,0.0000,0.0000 and if i type something it wont show anything cause the game mode has exited
Re: help with running a server [+rep] -
eesh - 11.03.2012
i suggest you put some test messages after every 3-4 lines in Login code. something like print("1"); and see at which number the prints stop. Itll give you an idea of whats crashing the server
Re: help with running a server [+rep] -
WardenCS - 11.03.2012
well i checked and it puts me at the right pos but when it spawns me at the right pos,the gamemode just exit
Re: help with running a server [+rep] -
eesh - 11.03.2012
then try doing the same under OnPlayerSpawn.