crashing on spawn
#1

Quote:

public OnPlayerRequestClass(playerid, classid)
{
SpawnPlayer(playerid);
return 1;
}

public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid, Time), TextDrawShowForPlayer(playerid, Date);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
new rand = random(sizeof(RandomSpawn));
SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
SetPlayerFacingAngle(playerid, RandomSpawn[rand][2]);
GivePlayerWeapon(playerid,9, 1);
GivePlayerWeapon(playerid,24, 1000);
GivePlayerWeapon(playerid,26, 1000);
GivePlayerWeapon(playerid,28, 2000);
GivePlayerWeapon(playerid,31, 2000);
GivePlayerWeapon(playerid,34, 500);
return 1;
}

help?
Reply
#2

1- you can chang your SetPlayerFacingAngle to setplayerLookat
check this
https://sampwiki.blast.hk/wiki/SetPlayerCameraLookAt

or SetPlayerPos(playerid,0.0,0.0,3.0); // in place of SetPlayerFacingAngle , and edit the Float X,Y,Z with ur cords,
PHP код:
Parameters:
(
playerid,Float:x,Float:y,Float:z)
playerid    The ID of the player to set the position of
Float
:x    The X coordinate to position the player at
Float
:y    The Y coordinate to position the player at
Float
:z    The Z coordinate to position the player at
Returns    This 
function doesn't return a specific value. 
Try this code first before you'll do what i told you in 1

PHP код:
public OnPlayerRequestClass(playeridclassid)
{
SpawnPlayer(playerid);
return 
1;
}
public 
OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playeridTime), TextDrawShowForPlayer(playeridDate);
SetPlayerSkin(playeridPlayerInfo[playerid][pSkin]);
new 
rand random(sizeof(RandomSpawn));
SetPlayerPos(playeridRandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
SetPlayerFacingAngle(playerid0);
GivePlayerWeapon(playerid91);
GivePlayerWeapon(playerid241000);
GivePlayerWeapon(playerid261000);
GivePlayerWeapon(playerid282000);
GivePlayerWeapon(playerid312000);
GivePlayerWeapon(playerid34500);
return 
1;

Reply
#3

SA-MP 0.3z-RC4
Exception At Address: 0x004D2D8A
Base: 0x04770000

Registers:
EAX: 0x3F350CF3 EBX: 0x000002E8 ECX: 0x00000000 EDX: 0x00000000
ESI: 0x0028FCFC EDI: 0x00000000 EBP: 0x10CA06E8 ESP: 0x0028FC6C
EFLAGS: 0x00010246

Stack:
+0000: 0x0000001F 0x10CA4010 0x0028FCF4 0x00000000
+0010: 0x00000000 0x00000000 0x00000000 0x00000000
+0020: 0x00000000 0x3F350CF3 0x3F34FCF3 0x00000000
+0030: 0x00000000 0x00000000 0x00000000 0x00000000
+0040: 0x3F350674 0x3F34F674 0x004CF1B0 0x00000000
+0050: 0x0028FCF4 0x10CA4010 0x00000001 0x00000000
+0060: 0x00000020 0x004D36D5 0x004D2B90 0x0028FCF4
+0070: 0x09356B60 0x00000008 0x0028FD94 0x00000800
+0080: 0x00000000 0x00000000 0x00000001 0x10CA2C80
+0090: 0x00000000 0x3F800000 0x37000000 0x3FB80800
+00A0: 0xBF196000 0x00534590 0x0028FD28 0x3F800000
+00B0: 0x00B6FA74 0x09356B60 0x3F800000 0x00535F99
+00C0: 0x0A5F8F70 0x3C8B4396 0x00000C01 0x0932A460
+00D0: 0x005685C0 0x00000001 0x8A6A34C3 0x000000B8
+00E0: 0x0053C09A 0x0000001A 0x8A69A7CF 0x00000000
+00F0: 0x74E810FC 0x047EA746 0x8A69A7CF 0x047D5A46
+0100: 0x0000001A 0x8A69A7CF 0x00000000 0x0C61DA48
+0110: 0x0028FD6C 0x0028F840 0x0028FF78 0x04820884
+0120: 0x04842EB0 0x00000001 0x75CCF9B0 0x0053E986
+0130: 0x00000001 0x008241AF 0x004D9486 0x0053ECC2
+0140: 0x00000001 0x00619B71 0x0000001A 0x00000001
+0150: 0x00000001 0x0000000A 0x00748DA0 0x0000001A
+0160: 0x00000001 0x74E81225 0x00000000 0x0028FF88
+0170: 0x7EFDE000 0x01828CBE 0x4F0A6991 0x053002C0
+0180: 0x00000008 0x00000100 0x00000008 0x00000102
+0190: 0x43C80000 0x43960000 0x00000000 0x00000000
+01A0: 0x00000320 0x00000258 0x00000000 0x00000001
+01B0: 0x024501E0 0x00000200 0x00000000 0x012C0190
+01C0: 0x2D24D66E 0x00000190 0x0000012C 0x0000002C
+01D0: 0x0028FE2C 0x00825EA4 0x74E81225 0x00000000
+01E0: 0x7EFDE000 0xFFFFFFFF 0x00821D17 0x00000000
+01F0: 0x00000000 0x0028FF88 0x008246F1 0x00400000
+0200: 0x00000000 0x019D1A79 0x0000000A 0x00000094
+0210: 0x00000004 0x0000000A 0x040A08AE 0x00000001
+0220: 0x00000000 0x00000000 0x00000000 0x00000000
+0230: 0x00000000 0x00000000 0x00000000 0x00000000
+0240: 0x00000000 0x00000000 0x00000000 0x00000000
+0250: 0x00000000 0x00000000 0x00000000 0x00000000
+0260: 0x00000000 0x00000000 0x00000000 0x00000000
+0270: 0x00000000 0x00000000 0x00000000 0x00000000

SCM Op: 0x470, lDbg: 0 LastRendObj: 3850

Game Version: US 1.0

State Information: Ped Context: 0
P0 (0,0) P2 (0,0) P3 (0,0)
P4 (32,0) P5 (32,0) P6 (0,0)

everytime i crash its on respawn....
SA-MP 0.3z-RC4
Exception At Address: 0x004D2D8A
Base: 0x04770000

Registers:
EAX: 0x3F350CF3 EBX: 0x000002E8 ECX: 0x00000000 EDX: 0x00000000
ESI: 0x0028FCFC EDI: 0x00000000 EBP: 0x10CA06E8 ESP: 0x0028FC6C
EFLAGS: 0x00010246

Stack:
+0000: 0x0000001F 0x10CA4010 0x0028FCF4 0x00000000
+0010: 0x00000000 0x00000000 0x00000000 0x00000000
+0020: 0x00000000 0x3F350CF3 0x3F34FCF3 0x00000000
+0030: 0x00000000 0x00000000 0x00000000 0x00000000
+0040: 0x3F350674 0x3F34F674 0x004CF1B0 0x00000000
+0050: 0x0028FCF4 0x10CA4010 0x00000001 0x00000000
+0060: 0x00000020 0x004D36D5 0x004D2B90 0x0028FCF4
+0070: 0x09356B60 0x00000008 0x0028FD94 0x00000800
+0080: 0x00000000 0x00000000 0x00000001 0x10CA2C80
+0090: 0x00000000 0x3F800000 0x37000000 0x3FB80800
+00A0: 0xBF196000 0x00534590 0x0028FD28 0x3F800000
+00B0: 0x00B6FA74 0x09356B60 0x3F800000 0x00535F99
+00C0: 0x0A5F8F70 0x3C8B4396 0x00000C01 0x0932A460
+00D0: 0x005685C0 0x00000001 0x8A6A34C3 0x000000B8
+00E0: 0x0053C09A 0x0000001A 0x8A69A7CF 0x00000000
+00F0: 0x74E810FC 0x047EA746 0x8A69A7CF 0x047D5A46
+0100: 0x0000001A 0x8A69A7CF 0x00000000 0x0C61DA48
+0110: 0x0028FD6C 0x0028F840 0x0028FF78 0x04820884
+0120: 0x04842EB0 0x00000001 0x75CCF9B0 0x0053E986
+0130: 0x00000001 0x008241AF 0x004D9486 0x0053ECC2
+0140: 0x00000001 0x00619B71 0x0000001A 0x00000001
+0150: 0x00000001 0x0000000A 0x00748DA0 0x0000001A
+0160: 0x00000001 0x74E81225 0x00000000 0x0028FF88
+0170: 0x7EFDE000 0x01828CBE 0x4F0A6991 0x053002C0
+0180: 0x00000008 0x00000100 0x00000008 0x00000102
+0190: 0x43C80000 0x43960000 0x00000000 0x00000000
+01A0: 0x00000320 0x00000258 0x00000000 0x00000001
+01B0: 0x024501E0 0x00000200 0x00000000 0x012C0190
+01C0: 0x2D24D66E 0x00000190 0x0000012C 0x0000002C
+01D0: 0x0028FE2C 0x00825EA4 0x74E81225 0x00000000
+01E0: 0x7EFDE000 0xFFFFFFFF 0x00821D17 0x00000000
+01F0: 0x00000000 0x0028FF88 0x008246F1 0x00400000
+0200: 0x00000000 0x019D1A79 0x0000000A 0x00000094
+0210: 0x00000004 0x0000000A 0x040A08AE 0x00000001
+0220: 0x00000000 0x00000000 0x00000000 0x00000000
+0230: 0x00000000 0x00000000 0x00000000 0x00000000
+0240: 0x00000000 0x00000000 0x00000000 0x00000000
+0250: 0x00000000 0x00000000 0x00000000 0x00000000
+0260: 0x00000000 0x00000000 0x00000000 0x00000000
+0270: 0x00000000 0x00000000 0x00000000 0x00000000

SCM Op: 0x470, lDbg: 0 LastRendObj: 3850

Game Version: US 1.0

State Information: Ped Context: 0
P0 (0,0) P2 (0,0) P3 (0,0)
P4 (32,0) P5 (32,0) P6 (0,0)
Reply
#4

Sometimes i can die 30+times before a crash occurs,
Majority of the time some players crash 1out of 5 times on respawn.
Crashes only occur on respawn...


Quote:

public OnPlayerRequestClass(playerid, classid)
{
SpawnPlayer(playerid);
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid, Time), TextDrawShowForPlayer(playerid, Date);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
new rand = random(sizeof(RandomSpawn));
SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
SetPlayerFacingAngle(playerid, RandomSpawn[rand][2]);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 24, 1000);
GivePlayerWeapon(playerid, 26, 1000);
GivePlayerWeapon(playerid, 28, 2000);
GivePlayerWeapon(playerid, 31, 2000);
GivePlayerWeapon(playerid, 34, 500);
SetPlayerHealth(playerid,99999);
SetTimerEx("NoSpawnKill",5000,0,"i",playerid);
}
return 1;

}
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
PlayerInfo[playerid][pDeaths]++;
if(killerid != INVALID_PLAYER_ID)
{
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
PlayerInfo[killerid][pKills]++;
}
{
KillerLevel[killerid] += 1;
SetPlayerWantedLevel(killerid, KillerLevel[killerid]);
SendClientMessage(COLOR_WHITE, killerid, "You are now wanted for murder");
return 1;
}
}

public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
PlayerInfo[playerid][pDeaths]++;
if(killerid != INVALID_PLAYER_ID)
{
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
PlayerInfo[killerid][pKills]++;
}
{
KillerLevel[killerid] += 1;
SetPlayerWantedLevel(killerid, KillerLevel[killerid]);
SendClientMessage(COLOR_WHITE, killerid, "You are now wanted for murder");
return 1;
}
}
Reply
#5

Debug it. Comment stuff out and then slowly re-enable one line at a time until crashes happen. When a crash happens, you know the last thing that you uncommented caused it. It's either the skin or the textdraw. First thing I would do is print out the skin ID you're trying to set to see if it's valid.

Also, you should really learn how to indent...
Reply
#6

Reinstalled gta
Died 46 times before i crashed on respawn.
Found this in the chatlog right when i crashed..

Quote:

[20:16:49] Warning(s007): Exception 0xC0000005 at 0x4D1996

[20:16:49] Warning(s007): Exception 0xC0000005 at 0x4D1996

[20:16:49] Warning(s007): Exception 0xC0000005 at 0x4D1996

[20:16:49] Warning(s007): Exception 0xC0000005 at 0x4D1996

[20:16:49] Warning(s007): Exception 0xC0000005 at 0x4D1996

[20:16:49] Warning(s007): Exception 0xC0000005 at 0x4D1996

[20:16:49] Warning(s007): Exception 0xC0000005 at 0x4D1996

[20:16:49] Warning(s007): Exception 0xC0000005 at 0x4D1996

[20:16:49] Warning(s007): Exception 0xC0000005 at 0x4D1996

[20:16:49] Warning(s007): Exception 0xC0000005 at 0x4D1996


Quote:

SA-MP 0.3z-RC4
Exception At Address: 0x004D1996
Base: 0x04800000

Registers:
EAX: 0x096E1B10 EBX: 0x00000000 ECX: 0xC1000000 EDX: 0x3F35339A
ESI: 0x096E0180 EDI: 0x3F800000 EBP: 0x0A555FE8 ESP: 0x0028FC38
EFLAGS: 0x00010246

Stack:
+0000: 0x00000000 0x096E1B10 0x0028FCF4 0x0053AF47
+0010: 0x00000000 0x3F800000 0xBB27FFFE 0x3B000000
+0020: 0x3CC00000 0xBB27FFFE 0x3B000000 0x3CC00000
+0030: 0x00000000 0x00000000 0x00A903D0 0x00000000
+0040: 0x00000000 0x00A90750 0x00000000 0x00000000
+0050: 0x0047F21F 0x3BF804EE 0x00000000 0x3F35339A
+0060: 0x3F34D398 0x3BF80252 0x00000000 0x3F3531B2
+0070: 0x3F34D1B1 0x004D2E30 0x096E0180 0x004CF1B0
+0080: 0x096E0180 0x0028FCF4 0x096E1B10 0x00000001
+0090: 0x00000000 0x00000020 0x004D370B 0x004D2E10
+00A0: 0x0028FCF4 0x09416B60 0x00000008 0x0028FD94
+00B0: 0x00000800 0x00000000 0x00000000 0x00000001
+00C0: 0x096E78D8 0x00000000 0x00C81200 0x00503248
+00D0: 0x00000000 0x00000003 0x00000002 0x00A9B088
+00E0: 0x3F000000 0xC1100000 0x00000246 0x004D15F4
+00F0: 0x00535F99 0x121FF8F8 0x3CAAAAAA 0x00000C00
+0100: 0x093EA460 0x005685C0 0x00000001 0x89622BC8
+0110: 0x00000154 0x0053C09A 0x0000001A 0x8961AA1D
+0120: 0x00000000 0x74E810FC 0x0487A746 0x8961AA1D
+0130: 0x04865A46 0x0000001A 0x8961AA1D 0x00000000
+0140: 0x0C66DAE0 0x0028FD6C 0x0028F80C 0x0028FF78
+0150: 0x048B0884 0x048D2EB0 0x00000001 0x75CCF9B0
+0160: 0x0053E986 0x00000001 0x008241AF 0x004D9486
+0170: 0x0053ECC2 0x00000001 0x00619B71 0x0000001A
+0180: 0x00000001 0x00000001 0x0000000A 0x00748DA0
+0190: 0x0000001A 0x00000001 0x74E81225 0x00000000
+01A0: 0x0028FF88 0x7EFDE000 0x01828CBE 0x4F09617A
+01B0: 0x053B02C0 0x00000008 0x00000100 0x00000008
+01C0: 0x00000102 0x43C80000 0x43960000 0x00000000
+01D0: 0x00000000 0x00000320 0x00000258 0x00000000
+01E0: 0x00000001 0x023506E6 0x00000113 0x00000001
+01F0: 0x00000000 0x36AB361C 0x00000199 0x00000150
+0200: 0x0000002C 0x0028FE2C 0x00825EA4 0x74E81225
+0210: 0x00000000 0x7EFDE000 0xFFFFFFFF 0x00821D17
+0220: 0x00000000 0x00000000 0x0028FF88 0x008246F1
+0230: 0x00400000 0x00000000 0x01951B11 0x0000000A
+0240: 0x00000094 0x00000004 0x0000000A 0x040A08AE
+0250: 0x00000001 0x00000000 0x00000000 0x00000000
+0260: 0x00000000 0x00000000 0x00000000 0x00000000
+0270: 0x00000000 0x00000000 0x00000000 0x00000000

SCM Op: 0x77E, lDbg: 0 LastRendObj: 3276

Game Version: US 1.0

State Information: Ped Context: 0

Reply
#7

Posting opcodes isn't really going to help, because most people have no idea what they mean. You know WHEN the script causes a crash -- OnPlayerSpawn -- so you just need to find out what -- in OnPlayerSpawn -- is causing it.
Reply
#8

Are you sure there's a AddPlayerClass? even if it's set to 0 0 0 0 0, add it, once I didn't add it and it crashed me several times.
Reply
#9

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
Are you sure there's a AddPlayerClass? even if it's set to 0 0 0 0 0, add it, once I didn't add it and it crashed me several times.
no i dont have add player class at all,
i added it and still crashing randomly on respawn, I always see cj in a field near a barn for a split second during respawn
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)