when you die you close the game, I need help please
#1

Hi, change the gamemode as standard, the LVDM my way, I added another respawns and dying gives crash the game I watched hundreds of times and can not find the error. I am a bit messed and not know what else to do ... I need help please

I put a party that I think are wrong to see if you can do something =)

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  new playercash;
	if(killerid == INVALID_PLAYER_ID) {
    SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
    	} else {
	  	SendDeathMessage(killerid,playerid,reason);
			SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
			playercash = GetPlayerMoney(playerid);
			if (playercash > 0) {
				GivePlayerMoney(killerid, playercash);
				ResetPlayerMoney(playerid);
			}
			else
			{
			}
   	}
 	return 1;
}
Reply
#2

Quote:
Originally Posted by linoxtrala
Код:
			else
			{
			}
That's useless. Delete this for now.
Reply
#3

Quote:
Originally Posted by DeathOnaStick
Quote:
Originally Posted by linoxtrala
Код:
			else
			{
			}
That's useless. Delete this for now.
Thanks for your help, i'm very stupid and blind
Reply
#4

Quote:
Originally Posted by linoxtrala
Quote:
Originally Posted by DeathOnaStick
Quote:
Originally Posted by linoxtrala
Код:
			else
			{
			}
That's useless. Delete this for now.
Thanks for your help, i'm very stupid and blind
That's not all :P.

You need to give "playercash" a value, too. It's without a value at the moment, i guess.

Use GetPlayerMoney for that.

Cheers.
Reply
#5

ok, I get a warning
Код:
 C: \ Documents and Settings \ Administrator \ Desktop \ samp server \ gamemodes \ lvdm.pwn (242): warning 202: number of arguments does not match definition * line 242 is GivePlayerMoney (Killera );*[/ code]
Reply
#6

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new playercash;
    if(killerid == INVALID_PLAYER_ID)
        SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
    else
    {
        SendDeathMessage(killerid,playerid,reason);
        SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
        playercash = GetPlayerMoney(playerid);
        if (playercash > 0)
        {
            GivePlayerMoney(killerid, playercash);
            ResetPlayerMoney(playerid);
        }
    }
    return 1;
}
This compiles without any errors/warnings for me
Reply
#7

Quote:
Originally Posted by lrZ^ aka LarzI
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new playercash;
    if(killerid == INVALID_PLAYER_ID)
        SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
    else
    {
        SendDeathMessage(killerid,playerid,reason);
        SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
        playercash = GetPlayerMoney(playerid);
        if (playercash > 0)
        {
            GivePlayerMoney(killerid, playercash);
            ResetPlayerMoney(playerid);
        }
    }
    return 1;
}
This compiles without any errors/warnings for me
still giving me crash the game but now only occasionally but now only occasionally but does not compile error
Reply
#8

Try debugging.

here

Delete your server.log
Then try it.
If server crashes, post your server.log here.
Reply
#9

being equal, the first time you die, crash

------------------SERVER LOG----------------

SA:MP Dedicated Server
----------------------
v0.2X, ©2005-2008 SA:MP Team

[16:51:20]
[16:51:20] Server Plugins
[16:51:20] --------------
[16:51:20] Loaded 0 plugins.

[16:51:20]
[16:51:20] Filter Scripts
[16:51:20] ---------------
[16:51:20] Loading filter script 'V-Admin_Spa.amx'...
[16:51:20]
================================================== ==============
[16:51:20] V-Admin ha cargado
[16:51:20] Creado Por:
[16:51:20] Fecha lanzado(v0.1):
[16:51:20] Fecha lanzado(v0.4):
[16:51:20] Traducciуn Por
[16:51:20] ================================================== ==============
[16:51:20]

[16:51:20] Loading filter script 'GLSPD.amx'...
[16:51:20] Loading filter script 'HQISLA.amx'...
[16:51:20] Loaded 3 filter scripts.

[16:51:20]
----------------------------------
[16:51:20] Running LVDM ~MoneyGrub

[16:51:20] Coded By
[16:51:20] Jax
[16:51:20] ----------------------------------

[16:51:48] Incomming connection: 127.0.0.1:4544
[16:51:48] [join] [M3rX]M4k3D has joined the server (0:127.0.0.1)
[16:51:57] test1
[16:51:57] test2
[16:51:57] test3
[16:51:57] test4
[16:51:57] test5
[16:51:57] test8
[16:51:57] [death] [M3rX]M4k3D died 255
[16:52:11] [part] [M3rX]M4k3D has left the server (0:0)
[16:52:14] --- Server Shutting Down.
Reply
#10

Add prints after each line inside OnPlayerSpawn, the problem must be there.
Reply
#11

Quote:
Originally Posted by lrZ^ aka LarzI
Add prints after each line inside OnPlayerSpawn, the problem must be there.
sorry but i don't understand you... prints? what is prints?
Reply
#12

The function called 'print' as I've used in the code I posted.
I can do it for you one more time, if you post your OnPlayerSpawn code here. :P
Reply
#13

Quote:
Originally Posted by lrZ^ aka LarzI
The function called 'print' as I've used in the code I posted.
I can do it for you one more time, if you post your OnPlayerSpawn code here. :P
Sorry to bother you, but the truth is I'm a bit noob xD

Код:
public OnPlayerSpawn(playerid)
{
	GivePlayerMoney(playerid, PocketMoney);
	SetPlayerInterior(playerid,0);
	SetPlayerRandomSpawn(playerid);
	TogglePlayerClock(playerid,1);
	return 1;
}

public SetPlayerRandomSpawn(playerid)
{
	if (iSpawnSet[playerid] == 1)
	{
		new rand = random(sizeof(gCopPlayerSpawns));
		SetPlayerPos(playerid, gCopPlayerSpawns[rand][0], gCopPlayerSpawns[rand][1], gCopPlayerSpawns[rand][2]); // Warp the player
		SetPlayerFacingAngle(playerid, 270.0);
  }
  else if (iSpawnSet[playerid] == 0)
  {
		new rand = random(sizeof(gRandomPlayerSpawns));
		SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); // Warp the player
	}
	return 1;
}
Reply
#14

http://pastebin.com/m1e8c09ac

Do the same as I told you the last time.

Delete server.log
Try it out
Post server.log here (please use [ code] tags (without spaces)
Reply
#15

remains the same
Код:
----------

SA: MP Dedicated Server
----------------------
v0.2X, © 2005-2008 SA: MP Team

[17:21:08]
[17:21:08] Server Plugins
[17:21:08] --------------
[17:21:08] Loaded 0 plugins.

[17:21:08]
[17:21:08] Filter Scripts
[17:21:08] ---------------
[17:21:08] Loading filter script 'V-Admin_Spa.amx' ...
[17:21:08]
================================================== ==============
[17:21:08] loaded V-Admin
[17:21:08] Created By: Yaheli
[17:21:08] Date released (v0.1): April 28, 2008
[17:21:08] Date released (v0.4): July 23, 2008
[17:21:08] Translation by [K4L] ThePro
[17:21:08] =========================================== =====================
[17:21:08]

[17:21:08] Loading filter script 'GLSPD.amx' ...
[17:21:08] Loading filter script 'HQISLA.amx' ...
[17:21:08] Loaded 3 filter scripts.

[17:21:08]
----------------------------------
[17:21:08] Running LVDM ~ MoneyGrub

[17:21:08] Coded By
[17:21:08] Jax
[17:21:08] ----------------------------------

[17:21:35] Incomming connection: 127.0.0.1:1155
[17:21:35] [join] [M3rX] M4k3D has joined the server (0:127.0.0.1)
[17:21:42] test1
[17:21:42] test2
[17:21:42] test3
[17:21:42] test4
[17:21:42] test9
[17:21:42] test10
[17:21:42] test11
[17:21:42] test12
[17:21:42] test13
[17:21:42] test14
[17:23:33] test1
[17:23:33] test2
[17:23:33] test3
[17:23:33] test4
[17:23:33] test5
[17:23:33] test8
[17:23:33] [death] [M3rX] M4k3D died 255
[17:23:47] [part] [M3rX] M4k3D has left the server (0:0)
[17:23:52] --- Server Shutting Down.

[/ code]
Reply
#16

Either the server crashes after OnPlayerDeath returns, or during OnPlayerRequestSpawn.
Idk how to fix, but the problem is between there somewhere :S :/
Reply
#17

when someone kills me to respawn the game comes out.although I think we understand that the server is closed but in fact is what gives the game crash, the game closes but stays on the server
Reply
#18

Please i need help =)
Reply
#19

If you're using SetPlayerSkin() in OnPlayerSpawn(), in any of the parent functions it can cause crashes upon spawning.

See: https://sampwiki.blast.hk/wiki/SetSpawnInfo

Quote:

This function can be used to change the spawn information of a specific player. It allows you to automatically set someone's spawn weapons, their team, skin and spawn position, normally used in case of minigames or automatic-spawn systems. This function is more crash-safe then using SetPlayerSkin in OnPlayerSpawn and/or OnPlayerRequestClass, even though this has been fixed in 0.2.

You should also consider checking your filterscript, to see if anything co-insides with your OnPlayerDeath in your main script.
Reply
#20

Quote:
Originally Posted by Calon
If you're using SetPlayerSkin() in OnPlayerSpawn(), in any of the parent functions it can cause crashes upon spawning.
__________________________________________________ __________________________________________________ _

See: https://sampwiki.blast.hk/wiki/SetSpawnInfo

Quote:

This function can be used to change the spawn information of a specific player. It allows you to automatically set someone's spawn weapons, their team, skin and spawn position, normally used in case of minigames or automatic-spawn systems. This function is more crash-safe then using SetPlayerSkin in OnPlayerSpawn and/or OnPlayerRequestClass, even though this has been fixed in 0.2.

You should also consider checking your filterscript, to see if anything co-insides with your OnPlayerDeath in your main script.
if not ill understand the answer, I have nothing OnPlayerSpawn

I just want to be the spawn without weapons or anything just with the skin you chose
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)