OnPlayerRequestClass - OnPlayerDynamicObject not work
#1

Hi,
It works fine if I use CreateObject. I don't know what I'm doing wrong. I tried so many things but it just doesn't work. Streamer_Update and Streamer_UpdateEx make the objects just showing up for like half a second, then they'll disappear.

My OnPlayerRequestClass code;

Streamer_UpdateEx(playerid, Float:2479.4639, Float:2334.1392, Float:10.8890);

TogglePlayerSpectating(playerid, 0);
SetPlayerPos(playerid, 2479.4639, 2334.1392, 10.8890);
SetPlayerCameraPos(playerid,2482.7217, 2338.5298, 10.8890);
SetPlayerCameraLookAt(playerid,2481.3228, 2336.4272, 10.8890);
SetPlayerFacingAngle(playerid, 310.8140);

please help
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
What is OnPlayerDynamicObject meant to do? Most function names should include a verb.
OnPlayerDynamicObject I am using, sir, in that;

pawno/include/object.inc;
Код:
object()
{
	new tmpobjid;
    tmpobjid = CreateDynamicObject(19454, 2487.895507, 2336.786865, 11.520307, 0.000000, 0.000000, 0.000000, -1, -1, -1, 300.00, 300.00);
    SetDynamicObjectMaterial(tmpobjid, 0, 6988, "vgnfremnt1", "scmgarage1_128", 0x00000000);
    tmpobjid = CreateDynamicObject(19391, 2486.373291, 2341.487792, 11.510315, 0.000000, 0.000000, 90.899986, -1, -1, -1, 300.00, 300.00);
    SetDynamicObjectMaterial(tmpobjid, 0, 6988, "vgnfremnt1", "scmgarage1_128", 0x00000000);
    tmpobjid = CreateDynamicObject(19454, 2480.035888, 2341.464843, 11.510307, 0.000000, 0.000000, -90.000007, -1, -1, -1, 300.00, 300.00);
    SetDynamicObjectMaterial(tmpobjid, 0, 6988, "vgnfremnt1", "scmgarage1_128", 0x00000000);
    tmpobjid = CreateDynamicObject(19454, 2477.474121, 2336.666748, 11.500307, 0.000000, 0.000000, 0.000000, -1, -1, -1, 300.00, 300.00);
    SetDynamicObjectMaterial(tmpobjid, 0, 6988, "vgnfremnt1", "scmgarage1_128", 0x00000000);
    tmpobjid = CreateDynamicObject(19454, 2482.998779, 2331.884277, 11.510307, 0.000000, 0.000000, -90.000007, -1, -1, -1, 300.00, 300.00);
    SetDynamicObjectMaterial(tmpobjid, 0, 6988, "vgnfremnt1", "scmgarage1_128", 0x00000000);
}
Go to the my gamemode;
add OnGameModeInıt in object(); and go the the OnPlayerRequestSpawn add

Код:
Streamer_UpdateEx(playerid, Float:2479.4639, Float:2334.1392, Float:10.8890);
TogglePlayerSpectating(playerid, 0);
SetPlayerPos(playerid, 2479.4639, 2334.1392, 10.8890);
SetPlayerCameraPos(playerid,2482.7217, 2338.5298, 10.8890);
SetPlayerCameraLookAt(playerid,2481.3228, 2336.4272, 10.8890);
SetPlayerFacingAngle(playerid, 310.8140);
but objects just showing up for like half a second, then they'll disappear how can I solve this ?

Note: sometimes I can't understand because my english is bad I am so sorry for that we can bring a solution with examples
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
How many objects do you have?
118 sir.
Reply
#4

my problem continues please help
Reply
#5

try removing the Float word from Streamer_UpdateEx, if that doesn't work, try putting those objects in OnGameModeInit
Reply
#6

Quote:
Originally Posted by H4bdel
Посмотреть сообщение
try removing the Float word from Streamer_UpdateEx, if that doesn't work, try putting those objects in OnGameModeInit
"Try removing the Float word from Streamer_UpdateEx"

I deleted it but it doesn't work sir.

"try putting those objects in OnGameModeInit"
from there, sir.

QUOTE:
but objects just showing up for like half a second, then they'll disappear how can I solve this ?
Reply
#7

CreateDynamicObject is not working at OnPlayerRequestClass CreateDynamicObject Working if player done do spawn

You can try use :
Quote:

CreateObject(model, x, y, z, rx, ry, rz);

Reply
#8

Quote:
Originally Posted by GeorgeLimit
Посмотреть сообщение
CreateDynamicObject is not working at OnPlayerRequestClass CreateDynamicObject Working if player done do spawn

You can try use :
Streamer_UpdateEx is it not possible to use with?
Reply
#9

objects just showing up for like half a second, then they'll disappear how can I solve this ? please help
Reply
#10

Umm, I think you just need to remove the toggling of spectate mode, but if for some strange reason you need to do that.. then just make sure you do it well before you attempt to force update of objects at a location.. otherwise it's not needed and is the cause of the objects disappearing.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)