SA-MP Forums

Go Back   SA-MP Forums > SA-MP > Bug Reports

Reply
 
Thread Tools Display Modes
Old 13/09/2020, 02:26 PM   #1
OKStyle
High-roller
 
OKStyle's Avatar
 
Join Date: May 2008
Location: Russia, Orenburg Money: GTA$ 999,999,999
Posts: 3,138
Reputation: 147
Default CreateObject and Edit (0.3DL?)

After a long downtime, I returned to development again, but on the way I got an obstacle, which I still can't figure out.

So, I have a clear pwn, no filterscripts, no plugins.

1st step: Add 2 lines with CreateObject but after start of GM console says that 0 objects created. I'm try a timer from this thread https://forum.sa-mp.com/showthread.php?t=649801 , but it did not lead to the desired result.

2nd step: I'm add object ingame (via cmd with createobject) - object was created. I'm type cmd for select object - it works. BUT. When I click click on an object hoping to select it - game crashed.

Code:
SA-MP 0.3.DL-R1
Exception At Address: 0x041A2015
Base: 0x04130000

Registers:
EAX: 0x99222222	EBX: 0x0177F9FC	ECX: 0x00000000	EDX: 0x000002D7
ESI: 0x16B56EB8	EDI: 0x00000055	EBP: 0x0177F974	ESP: 0x0177F964
EFLAGS: 0x00210286

Stack:
+0000: 0x00000055   0x16B56EB8   0x041A28B8   0x00000000
+0010: 0x00000055   0x000002D6   0x00000056   0x000002D7
+0020: 0x16BD11B8   0x16B56EB8   0x0177FD18   0x00000000
+0030: 0xC088354B   0x00000000   0x00000000   0xC11F7B56
+0040: 0x3F99EA49   0x40478000   0x42AB08D3   0x443594C0
+0050: 0x43F1EB76   0x4433D7B4   0x00000000   0x01D070AC
+0060: 0x00000000   0x00000000   0x3F800000   0x00000001
+0070: 0xC0B6C162   0x3F99EA49   0x041A3312   0xC088354B
+0080: 0x4088354B   0x017D8488   0x76EFAEA0   0x0177FA58
+0090: 0x04410000   0x01D00000   0x3F800000   0x00000000
+00A0: 0x80000000   0x0177FA4C   0x80000000   0x3F800000
+00B0: 0x00000000   0x678A8F72   0x00000000   0x00000000
+00C0: 0x3F800000   0x44B40000   0xC0B6C162   0x3F99EA49
+00D0: 0x40478000   0x00000144   0x04199D4D   0x017D8488
+00E0: 0x76EFAEA0   0x0177FD18   0x00000000   0x000005A0
+00F0: 0x00000001   0x017D8488   0x76EFAEA0   0x0177FD18
+0100: 0x00000000   0x16B12228   0x0177FD18   0x04197915
+0110: 0x05B2E470   0x041A5595   0x041A55A4   0x017D8488
+0120: 0x007F99B0   0x00000000   0x0177FB4C   0x676783AC
+0130: 0x08046F84   0x05F03040   0x67677ED0   0x676783BB
+0140: 0x08046F84   0x8001D2C0   0x00000000   0x00000000
+0150: 0x00000000   0x08B1D000   0x0000001C   0x00000000
+0160: 0x00000000   0x17E9ABC0   0x08B1D000   0x08B1D000
+0170: 0x00000000   0x00000000   0x0000001C   0x08043280
+0180: 0x0177FB88   0x00000002   0x00000000   0x00000000
+0190: 0x00000000   0x00000007   0x00000000   0x00000000
+01A0: 0x00000000   0x00000000   0x00000000   0x00004E20
+01B0: 0x00000000   0x00000000   0x00000000   0x00000000
+01C0: 0x00000000   0x00000000   0x00000000   0x00000000
+01D0: 0x00000194   0x05EE7B00   0x01CE6404   0x01CE6404
+01E0: 0x00000329   0x01CE6404   0x0177FB70   0x677EE8F6
+01F0: 0x00000194   0x05EE7B00   0x01C9D060   0x01C9D060
+0200: 0x000FE38F   0x00000000   0x00000000   0x0177FB8C
+0210: 0x678627C3   0x0000001A   0x00000001   0x00000000
+0220: 0x001FC71E   0x00000000   0x0177FBA8   0x6786290B
+0230: 0x05EE7B00   0x01D045C0   0x00000001   0x0177FC15
+0240: 0x08076A88   0x0177FC48   0x677FAD1B   0x05EE7B00
+0250: 0x0177FBF4   0xFFFE572E   0x05EF45E0   0x01D045C0
+0260: 0x677BCE6B   0x00000000   0x0058C097   0x00000000
+0270: 0x0000001A   0x00000001   0x76EFE9E0   0x00000000

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

Game Version: US 1.0

State Information: Ped Context: 0
Can all this work without a streamer?
__________________
O.K.Style™ Laboratory
Kalcor: "... it's makes the game look like it's not GTA. This mod is called San Andreas Multiplayer. It's not a custom game engine which you can script..."
OKStyle is offline   Reply With Quote
Old 14/09/2020, 07:14 AM   #2
OKStyle
High-roller
 
OKStyle's Avatar
 
Join Date: May 2008
Location: Russia, Orenburg Money: GTA$ 999,999,999
Posts: 3,138
Reputation: 147
Default Re: CreateObject and Edit (0.3DL?)

Try install 0.3.7-R4, the same (when select object):

Code:
SA-MP 0.3.7-R4
Exception At Address: 0x041025A5
Base: 0x04090000

Registers:
EAX: 0x99222222	EBX: 0x0177F9FC	ECX: 0x00000000	EDX: 0x00000119
ESI: 0x12BA6EC8	EDI: 0x000003DF	EBP: 0x0177F974	ESP: 0x0177F964
EFLAGS: 0x00210286

Stack:
+0000: 0x000003DF   0x12BA6EC8   0x04102E48   0x00000000
+0010: 0x000003DF   0x00000118   0x000003E0   0x00000119
+0020: 0x12C1E788   0x12BA6EC8   0x0177FD18   0x00000000
+0030: 0xC1520577   0x00000000   0x00000000   0xC5258486
+0040: 0x442C8336   0x42818F5C   0x4477F242   0x438C6ADF
+0050: 0x4495BBFD   0x4383E2F8   0x00000000   0x01CAB32C
+0060: 0x80000000   0x00000000   0x3F800000   0x00000001
+0070: 0xC5258486   0x44293B20   0x041038A2   0xC1520577
+0080: 0x41520577   0x018387A0   0x76EFAEA0   0x0177FA58
+0090: 0x04330000   0x01CA0000   0xB33BBD2E   0xBF800000
+00A0: 0x80000000   0x0177FA4C   0x3F800000   0xB33BBD2E
+00B0: 0x00000000   0x6CD88F72   0x80000000   0x00000000
+00C0: 0x3F800000   0x44B40000   0xC5258486   0x44293B20
+00D0: 0x42818F5C   0x00000144   0x040FA2CD   0x018387A0
+00E0: 0x76EFAEA0   0x0177FD18   0x00000000   0x000005A0
+00F0: 0x00000001   0x018387A0   0x76EFAEA0   0x0177FD18
+0100: 0x00000000   0x12B62228   0x0177FD18   0x040F7E65
+0110: 0x0D5386C0   0x04105B45   0x04105B54   0x018387A0
+0120: 0x007F99B0   0x00000000   0x0177FB4C   0x6CB283AC
+0130: 0x01C0EF04   0x0BDB9040   0x6CB27ED0   0x6CB283BB
+0140: 0x01C0EF04   0x400052C0   0x00000000   0x00000000
+0150: 0x00000000   0x0517F000   0x0000001C   0x00000000
+0160: 0x00000000   0x0E06C9B0   0x0517F000   0x0517F000
+0170: 0x00000000   0x00000000   0x0000001C   0x01C0B200
+0180: 0x0177FB88   0x00000002   0x00000000   0x00000000
+0190: 0x00000000   0x00000007   0x00000000   0x00000000
+01A0: 0x00000000   0x00000000   0x00000000   0x00004E20
+01B0: 0x00000000   0x00000000   0x00000000   0x00000000
+01C0: 0x00000000   0x00000000   0x00000000   0x00000000
+01D0: 0x00000874   0x0BD9BC20   0x01C87584   0x01C87584
+01E0: 0x000010E9   0x01C87584   0x0177FB70   0x6CCCE8F6
+01F0: 0x00000874   0x0BD9BC20   0x01BD7680   0x01BD7680
+0200: 0x002FDE79   0x00000000   0x00000000   0x0177FB8C
+0210: 0x6CD427C3   0x0000001A   0x00000001   0x00000000
+0220: 0x005FBCF2   0x00000000   0x0177FBA8   0x6CD4290B
+0230: 0x0BD9BC20   0x01CA8840   0x00000001   0x0177FC15
+0240: 0x0BD6FFE8   0x0177FC48   0x6CCDAD1B   0x0BD9BC20
+0250: 0x0177FBF4   0xFA64A127   0x0BD86E20   0x01CA8840
+0260: 0x6CC9CE6B   0x00000000   0x0058C097   0x00000000
+0270: 0x0000001A   0x00000001   0x76EFE9E0   0x00000000

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

Game Version: US 1.0

State Information: Ped Context: 0
__________________
O.K.Style™ Laboratory
Kalcor: "... it's makes the game look like it's not GTA. This mod is called San Andreas Multiplayer. It's not a custom game engine which you can script..."
OKStyle is offline   Reply With Quote
Old 14/09/2020, 11:07 AM   #3
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,863
Reputation: 1693
Default Re: CreateObject and Edit (0.3DL?)

Quote:
but after start of GM console says that 0 objects created.
It never does. It tells the number of vehicle models.

What is your exact, full code you're using that produces this bug?
__________________
When the opportunity presents itself to flip-a da table, uh, you flip-a da table.

Discord: Kwarde#8009
Kwarde is offline   Reply With Quote
Old 14/09/2020, 11:55 AM   #4
OKStyle
High-roller
 
OKStyle's Avatar
 
Join Date: May 2008
Location: Russia, Orenburg Money: GTA$ 999,999,999
Posts: 3,138
Reputation: 147
Default Re: CreateObject and Edit (0.3DL?)

Quote:
Originally Posted by Kwarde View Post
It never does. It tells the number of vehicle models.
I'm not talking about this line)
Code:
Number of vehicle models: 0
I'm typed my code:
pawn Code:
new max_objects = CreateObject(1000, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
printf("Objects: %d", max_objects - 1);
DestroyObject(max_objects);

Quote:
Originally Posted by Kwarde View Post
What is your exact, full code you're using that produces this bug?
Today I checked the work with the streamer - the object is created, but when you try to select it with a mouse, the game crashes in the same way as without it.

Full listing:
pawn Code:
#include <a_samp>
public OnFilterScriptInit()
{
    CreateObject(6973, -2648.28271, 676.92383, 64.78, 0.0, 0.0, -90.0);
    CreateObject(6973, -2648.28271, 676.92383, 64.78, 0.0, 0.0, -90.0);
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    new idx, cmd[256];
    cmd = strtok(cmdtext, idx);
    if(!strcmp(cmd, "/a_sdo", true))
    {
        SelectObject(playerid);
        return 1;
    }
    return 0;
}
public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
{
    EditObject(playerid, objectid);
    return 0;
}
public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
    new Float:oldX, Float:oldY, Float:oldZ, Float:oldRotX, Float:oldRotY, Float:oldRotZ;
    GetObjectPos(objectid, oldX, oldY, oldZ);
    GetObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
    if(response == EDIT_RESPONSE_FINAL)
    {
        printf("CreateObject(%d, %.4f, %.4f, %.4f, %.2f, %.2f, %.2f);", GetObjectModel(objectid), fX, fY, fZ, fRotX, fRotY, fRotZ);
        return 1;
    }
    if(response == EDIT_RESPONSE_CANCEL)
    {
        SetObjectPos(objectid, oldX, oldY, oldZ);
        SetObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
        return 1;
    }
    return 0;
}
stock strtok(const string[], &index)
{
    new length = strlen(string);
    while((index < length) && (string[index] <= ' ')) index++;
    new offset = index, result[20];
    while((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
__________________
O.K.Style™ Laboratory
Kalcor: "... it's makes the game look like it's not GTA. This mod is called San Andreas Multiplayer. It's not a custom game engine which you can script..."
OKStyle is offline   Reply With Quote
Old 15/09/2020, 06:18 PM   #5
bybyby
Little Clucker
 
bybyby's Avatar
 
Join Date: Dec 2018
Location: Узбекистан,Город Фергана
Posts: 26
Reputation: 3
Default Re: CreateObject and Edit (0.3DL?)

привет ок стиль так я понял твоём коде сначала создоётся переменная для обекта а потом к нему присваивается сам обект твой код:

new max_objects = CreateObject ( 1000 , 0,0 , 0,0 , 0,0 , 0,0 , 0,0 , 0,0 ) ;
printf ( "Объекты:% d" , max_objects - 1 ) ;
DestroyObject ( max_objects ) ;

я немного не понял как ты принтишь число обекта с -1 так же в переменном присвоено ид обекта или сам обект в целом виде?

я не много запутался всё же ни как понимаю твоего кода
bybyby is offline   Reply With Quote
Old 15/09/2020, 07:19 PM   #6
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,863
Reputation: 1693
Default Re: CreateObject and Edit (0.3DL?)

Oh wait a minute, I overlooked it being a game crash, I assumed it to be a server crash.
Anyway, that seems to be related to your client/PC. I just checked with both 0.3.7-R4 (client)+0.3.7-R2 (server) and 0.3.DL-R1 (client+server), empty gamemode, no plugins, ran that script as a filterscript, no issues.

Maybe try uninstalling SAMP and GTA SA (and deleting all files, such as the files in your documents, eventually virtual store, registry) and installing them again (and rebooting your PC before installing again due to possible issues with gtaweap3.ttf and sampaux2.ttf).
If that doesn't work I can't help you.
__________________
When the opportunity presents itself to flip-a da table, uh, you flip-a da table.

Discord: Kwarde#8009
Kwarde is offline   Reply With Quote
Old 16/09/2020, 08:08 AM   #7
OKStyle
High-roller
 
OKStyle's Avatar
 
Join Date: May 2008
Location: Russia, Orenburg Money: GTA$ 999,999,999
Posts: 3,138
Reputation: 147
Default Re: CreateObject and Edit (0.3DL?)

Tonight I came to the conclusion that it might be in the GUI, or rather in the font. Since the dialogs work fine, the font is to blame. I reinstalled them - nothing changed.

Then I thought it was due to the fact that I run the game from a flash drive, but after transferring it to the hard drive, nothing changed either.
__________________
O.K.Style™ Laboratory
Kalcor: "... it's makes the game look like it's not GTA. This mod is called San Andreas Multiplayer. It's not a custom game engine which you can script..."
OKStyle is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Skin desync, CreateObject disappear after edit. KubiPL Bug Reports 0 15/07/2014 08:21 AM
[GameMode] [EDIT]Fizz Tdm Edit (Added New features) [MK]Man_Deep Gamemode Scripts 24 26/06/2013 10:29 AM
CreateObject Mattakil Scripting Help 7 13/04/2013 07:30 PM
Give me a tool to edit .dff files i want to edit a vehicle Commandos General 2 08/07/2011 10:33 AM
CreateObject Tisca Help Archive 6 13/06/2009 12:54 AM


All times are GMT. The time now is 04:24 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.