Post: origin floats
10-13-2014, 11:46 AM #1
seanhellen
Are you high?
(adsbygoogle = window.adsbygoogle || []).push({}); Hi all - I have borrowed oldschools script for spawning entities and something has confused me - when I call it, the ps3 freezes as i randomly tried to put 0,0 where the floats part is as I try to put origins/angles floats in and it doesn't like it (undefined I think VS says)...anyways, here is oldschools script I am using;

    opd_s G_SetModel_t = { 0x01BEF5C, TOC };
void(*G_SetModel)(int clientIndex, const char* Model) = (void(*)(int, const char*))&G_SetModel_t;

opd_s G_Spawn_t = { 0x01C058C, TOC };
int(* G_Spawn)() = (int(*)())&G_Spawn_t;

opd_s SV_SetBrushModel_t = { 0x0022925C, TOC };
void(*SV_SetBrushModel)(int Entity) = (void(*)(int))&SV_SetBrushModel_t;

opd_s SP_Script_Model_t = { 0x01B6F68, TOC };
void(*SP_Script_Model)(int Entity) = (void(*)(int))&SP_Script_Model_t;

opd_s SV_UnlinkEntity_t = { 0x002377B8, TOC };
void(*SV_UnlinkEntity)(int Entity) = (void(*)(int))&SV_UnlinkEntity_t;

opd_s SV_linkEntity_t = { 0x00237848, TOC };
void(*SV_linkEntity)(int Entity) = (void(*)(int))&SV_linkEntity_t;

int SpawnEntity( float* Origin, float* Angles, const char* Model = "com_plasticcase_green_big_us_dirt", int Index = 2)
{
int Entity = (int)G_Spawn();
PS3::WriteFloat(Entity + 0x138, Origin, 3);
PS3::WriteFloat(Entity + 0x144, Angles, 3);
G_SetModel(Entity, Model);
SP_Script_Model(Entity);
SV_UnlinkEntity(Entity);
*(char*)(Entity + 0x101) = 4;
*(int*)(Entity + 0x8C) = Index;
SV_SetBrushModel(Entity);
SV_linkEntity(Entity);
return Entity;
}


I noticed it says write the floats, but there isn't anything telling the PS3 where to get the floats from...could this be it? I dont know...at the moment I am using

    Models::SpawnEntity(0, 0, "com_plasticcase_green_big_us_dirt", 2); I AM USING 0,0 JUST SO IT WOULD LET ME BUILD IT - I WAS UNDER NO ILLUSION IT WOULD WORK Happy


to call it - when typing, it prompts me to use float* Origin and float* Angles but I dont know what to do with that and if i type Origins and Angles in, it just says undefined...how would I define it? Also, what is the Index thing at the end?

P.S you probably guessed I am new to all this and am completely lost in C++ - with a lot of help from shark, I managed to get it done on BO2 with C#, but this is all a bit new still Smile
(adsbygoogle = window.adsbygoogle || []).push({});
10-23-2014, 07:59 PM #2
Crimzic
Do a barrel roll!
Originally posted by seanhellen View Post
Hi all - I have borrowed oldschools script for spawning entities and something has confused me - when I call it, the ps3 freezes as i randomly tried to put 0,0 where the floats part is as I try to put origins/angles floats in and it doesn't like it (undefined I think VS says)...anyways, here is oldschools script I am using;

    opd_s G_SetModel_t = { 0x01BEF5C, TOC };
void(*G_SetModel)(int clientIndex, const char* Model) = (void(*)(int, const char*))&G_SetModel_t;

opd_s G_Spawn_t = { 0x01C058C, TOC };
int(* G_Spawn)() = (int(*)())&G_Spawn_t;

opd_s SV_SetBrushModel_t = { 0x0022925C, TOC };
void(*SV_SetBrushModel)(int Entity) = (void(*)(int))&SV_SetBrushModel_t;

opd_s SP_Script_Model_t = { 0x01B6F68, TOC };
void(*SP_Script_Model)(int Entity) = (void(*)(int))&SP_Script_Model_t;

opd_s SV_UnlinkEntity_t = { 0x002377B8, TOC };
void(*SV_UnlinkEntity)(int Entity) = (void(*)(int))&SV_UnlinkEntity_t;

opd_s SV_linkEntity_t = { 0x00237848, TOC };
void(*SV_linkEntity)(int Entity) = (void(*)(int))&SV_linkEntity_t;

int SpawnEntity( float* Origin, float* Angles, const char* Model = "com_plasticcase_green_big_us_dirt", int Index = 2)
{
int Entity = (int)G_Spawn();
PS3::WriteFloat(Entity + 0x138, Origin, 3);
PS3::WriteFloat(Entity + 0x144, Angles, 3);
G_SetModel(Entity, Model);
SP_Script_Model(Entity);
SV_UnlinkEntity(Entity);
*(char*)(Entity + 0x101) = 4;
*(int*)(Entity + 0x8C) = Index;
SV_SetBrushModel(Entity);
SV_linkEntity(Entity);
return Entity;
}


I noticed it says write the floats, but there isn't anything telling the PS3 where to get the floats from...could this be it? I dont know...at the moment I am using

    Models::SpawnEntity(0, 0, "com_plasticcase_green_big_us_dirt", 2); I AM USING 0,0 JUST SO IT WOULD LET ME BUILD IT - I WAS UNDER NO ILLUSION IT WOULD WORK Happy


to call it - when typing, it prompts me to use float* Origin and float* Angles but I dont know what to do with that and if i type Origins and Angles in, it just says undefined...how would I define it? Also, what is the Index thing at the end?

P.S you probably guessed I am new to all this and am completely lost in C++ - with a lot of help from shark, I managed to get it done on BO2 with C#, but this is all a bit new still Smile

Huuh...
10-23-2014, 08:21 PM #3
seanhellen
Are you high?
Ye i given up on it now

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo