Post: [SPRX] Solid Models
08-28-2014, 07:43 PM #1
Sticky
Mary J Wannnnna
(adsbygoogle = window.adsbygoogle || []).push({}); Hey NGU I was bored so I ported seb5594's spawn solid model function to c++ with the help of Bad Luck Brian!

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

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

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

opd_s SV_LinkEntity_t = { 0x32C3A0, TOC };
void(*SV_LinkEntity)(int Entity) = (void(*)(int))&SV_LinkEntity_t;

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


int strCmp(char* a, char* b)
{
int diff;
if(a[0] == 0x00 || b[0] == 0x00){return -1;}//Strings are NULL
for(int i = 0;i<0x1024;i++)
{
if(a[i] == 0x00 || b[i] == 0x00){break;}//Reached end of str
if(a[i] != b[i]){diff++;}
}
return diff;
}

void MakeSolid(int Entity, const char* Map)
{
SV_UnlinkEntity(Entity);
*(char*)(Entity + 0x101) = 4;
int Brush = 0;

if(strCmp((char*)Map, "mp_prisonbreak") == 0){
Brush = G_Entity(0x3Cool Man (aka Tustin);
}
else if(strCmp((char*)Map, "mp_dart") == 0){
Brush = G_Entity(0x6B);
}
else if(strCmp((char*)Map, "mp_prisonbreak") == 0){
Brush = G_Entity(0x3Cool Man (aka Tustin);
}
else if(strCmp((char*)Map, "mp_dart") == 0){
Brush = G_Entity(0x6B);
}
else if(strCmp((char*)Map, "mp_lonestar") == 0){
Brush = G_Entity(0x6A);
}
else if(strCmp((char*)Map, "mp_frag") == 0){
Brush = G_Entity(0x55);
}
else if(strCmp((char*)Map, "mp_snow") == 0){
Brush = G_Entity(0x56);
}
else if(strCmp((char*)Map, "mp_fahrenheit") == 0){
Brush = G_Entity(0xACool Man (aka Tustin);
}
else if(strCmp((char*)Map, "mp_hasima") == 0){
Brush = G_Entity(0x63);
}
else if(strCmp((char*)Map, "mp_warhawk") == 0){
Brush = G_Entity(0x45);
}
else if(strCmp((char*)Map, "mp_sovereign") == 0){
Brush = G_Entity(0x72);
}
else if(strCmp((char*)Map, "mp_zebra") == 0){
Brush = G_Entity(0x44);
}
else if(strCmp((char*)Map, "mp_skeleton") == 0){
Brush = G_Entity(0x3A);
}
else if(strCmp((char*)Map, "mp_chasm") == 0){
Brush = G_Entity(0x49);
}
else if(strCmp((char*)Map, "mp_flooded") == 0){
Brush = G_Entity(0x57);
}
else if(strCmp((char*)Map, "mp_strikezone") == 0){
Brush = G_Entity(0x57);
}
else Brush = NULL;
*(int*)(Entity + 0x8C) = *(int*)(Brush + 0x8C);
Or_Int32(Entity + 0x11C, Entity + 0x11C);
SV_LinkEntity(Entity);
}

int SpawnModel(const char* Map, const char* Model, float X, float Y, float Z, float Pitch, float Yaw, float Roll)
{
int Entity = *(int*)(G_Spawn());
*(float*)(Entity + 0) = X;
*(float*)(Entity + 4) = Y;
*(float*)(Entity + Cool Man (aka Tustin) = Z;
*(float*)(Entity + 12) = Pitch;
*(float*)(Entity + 16) = Yaw;
*(float*)(Entity + 20) = Roll;
G_SetModel(Entity, Model);
SP_Script_Model(Entity);
MakeSolid(Entity, Map);
return Entity;
}


Credits:
Sticky
seb5594
Bad Luck Brian

The following 6 users say thank you to Sticky for this useful post:

/SneakerStreet/, iTпDM, SaberNGU, Swaqq, TheSaltCracka, xROccOx
08-29-2014, 12:26 AM #2
Originally posted by Sticky View Post
Hey NGU I was bored so I ported seb5594's spawn solid model function to c++ with the help of Bad Luck Brian!

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

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

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

opd_s SV_LinkEntity_t = { 0x32C3A0, TOC };
void(*SV_LinkEntity)(int Entity) = (void(*)(int))&SV_LinkEntity_t;

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


int strCmp(char* a, char* b)
{
int diff;
if(a[0] == 0x00 || b[0] == 0x00){return -1;}//Strings are NULL
for(int i = 0;i<0x1024;i++)
{
if(a[i] == 0x00 || b[i] == 0x00){break;}//Reached end of str
if(a[i] != b[i]){diff++;}
}
return diff;
}

void MakeSolid(int Entity, const char* Map)
{
SV_UnlinkEntity(Entity);
*(char*)(Entity + 0x101) = 4;
int Brush = 0;

if(strCmp((char*)Map, "mp_prisonbreak") == 0){
Brush = G_Entity(0x3Cool Man (aka Tustin);
}
else if(strCmp((char*)Map, "mp_dart") == 0){
Brush = G_Entity(0x6B);
}
else if(strCmp((char*)Map, "mp_prisonbreak") == 0){
Brush = G_Entity(0x3Cool Man (aka Tustin);
}
else if(strCmp((char*)Map, "mp_dart") == 0){
Brush = G_Entity(0x6B);
}
else if(strCmp((char*)Map, "mp_lonestar") == 0){
Brush = G_Entity(0x6A);
}
else if(strCmp((char*)Map, "mp_frag") == 0){
Brush = G_Entity(0x55);
}
else if(strCmp((char*)Map, "mp_snow") == 0){
Brush = G_Entity(0x56);
}
else if(strCmp((char*)Map, "mp_fahrenheit") == 0){
Brush = G_Entity(0xACool Man (aka Tustin);
}
else if(strCmp((char*)Map, "mp_hasima") == 0){
Brush = G_Entity(0x63);
}
else if(strCmp((char*)Map, "mp_warhawk") == 0){
Brush = G_Entity(0x45);
}
else if(strCmp((char*)Map, "mp_sovereign") == 0){
Brush = G_Entity(0x72);
}
else if(strCmp((char*)Map, "mp_zebra") == 0){
Brush = G_Entity(0x44);
}
else if(strCmp((char*)Map, "mp_skeleton") == 0){
Brush = G_Entity(0x3A);
}
else if(strCmp((char*)Map, "mp_chasm") == 0){
Brush = G_Entity(0x49);
}
else if(strCmp((char*)Map, "mp_flooded") == 0){
Brush = G_Entity(0x57);
}
else if(strCmp((char*)Map, "mp_strikezone") == 0){
Brush = G_Entity(0x57);
}
else Brush = NULL;
*(int*)(Entity + 0x8C) = *(int*)(Brush + 0x8C);
Or_Int32(Entity + 0x11C, Entity + 0x11C);
SV_LinkEntity(Entity);
}

int SpawnModel(const char* Map, const char* Model, float X, float Y, float Z, float Pitch, float Yaw, float Roll)
{
int Entity = *(int*)(G_Spawn());
*(float*)(Entity + 0) = X;
*(float*)(Entity + 4) = Y;
*(float*)(Entity + Cool Man (aka Tustin) = Z;
*(float*)(Entity + 12) = Pitch;
*(float*)(Entity + 16) = Yaw;
*(float*)(Entity + 20) = Roll;
G_SetModel(Entity, Model);
SP_Script_Model(Entity);
MakeSolid(Entity, Map);
return Entity;
}


Credits:
Sticky
seb5594
Bad Luck Brian


Le epic hax m8
08-29-2014, 06:15 AM #3
iTпDM
Vault dweller
Nice Release Sticky :yes:
08-29-2014, 04:21 PM #4
top_top
Pokemon Trainer
Imports System

Private G_SetModel_t As New opd_s(&H28F95C, TOC)
Private Delegate Sub G_SetModelDelegate(ByVal clientIndex As Integer, ByVal Model As String)
Private G_SetModel As G_SetModelDelegate
'C++ TO VB CONVERTER TODO TASK: The following statement was not recognized, possibly due to an unrecognized macro:
G_SetModel = (void(*)(Integer, const SByte*))&G_SetModel_t

Private G_Spawn_t As New opd_s(&H290D68, TOC)
Private Delegate Function G_SpawnDelegate() As Integer
Private G_Spawn As G_SpawnDelegate
'C++ TO VB CONVERTER TODO TASK: The following statement was not recognized, possibly due to an unrecognized macro:
G_Spawn = (Integer(*)())&G_Spawn_t

Private SV_UnlinkEntity_t As New opd_s(&H32C320, TOC)
Private Delegate Sub SV_UnlinkEntityDelegate(ByVal Entity As Integer)
Private SV_UnlinkEntity As SV_UnlinkEntityDelegate
'C++ TO VB CONVERTER TODO TASK: The following statement was not recognized, possibly due to an unrecognized macro:
SV_UnlinkEntity = (void(*)(Integer))&SV_UnlinkEntity_t

Private SV_LinkEntity_t As New opd_s(&H32C3A0, TOC)
Private Delegate Sub SV_LinkEntityDelegate(ByVal Entity As Integer)
Private SV_LinkEntity As SV_LinkEntityDelegate
'C++ TO VB CONVERTER TODO TASK: The following statement was not recognized, possibly due to an unrecognized macro:
SV_LinkEntity = (void(*)(Integer))&SV_LinkEntity_t

Private SP_Script_Model_t As New opd_s(&H286620, TOC)
Private Delegate Sub SP_Script_ModelDelegate(ByVal Entity As Integer)
Private SP_Script_Model As SP_Script_ModelDelegate
'C++ TO VB CONVERTER TODO TASK: The following statement was not recognized, possibly due to an unrecognized macro:
SP_Script_Model = (void(*)(Integer))&SP_Script_Model_t


Private Function strCmp(ByRef a As String, ByRef b As String) As Integer
Dim diff As Integer
If AscW(a.Chars(0)) = &H0 OrElse AscW(b.Chars(0)) = &H0 Then 'Strings are NULL
Return -1
End If
Dim i As Integer = 0
Do While i<&H1024
If AscW(a.Chars(i)) = &H0 OrElse AscW(b.Chars(i)) = &H0 Then 'Reached end of str
Exit Do
End If
If a.Chars(i) <> b.Chars(i) Then
diff += 1
End If
i += 1
Loop
Return diff
End Function

Private Sub MakeSolid(ByVal Entity As Integer, ByVal Map As String)
SV_UnlinkEntity(Entity)
CSByte(Entity + &H101) = 4
Dim Brush As Integer = 0

If strCmp(CSByte(Map), "mp_prisonbreak") = 0 Then
Brush = G_Entity(&H3Cool Man (aka Tustin)
ElseIf strCmp(CSByte(Map), "mp_dart") = 0 Then
Brush = G_Entity(&H6B)
ElseIf strCmp(CSByte(Map), "mp_prisonbreak") = 0 Then
Brush = G_Entity(&H3Cool Man (aka Tustin)
ElseIf strCmp(CSByte(Map), "mp_dart") = 0 Then
Brush = G_Entity(&H6B)
ElseIf strCmp(CSByte(Map), "mp_lonestar") = 0 Then
Brush = G_Entity(&H6A)
ElseIf strCmp(CSByte(Map), "mp_frag") = 0 Then
Brush = G_Entity(&H55)
ElseIf strCmp(CSByte(Map), "mp_snow") = 0 Then
Brush = G_Entity(&H56)
ElseIf strCmp(CSByte(Map), "mp_fahrenheit") = 0 Then
Brush = G_Entity(&HACool Man (aka Tustin)
ElseIf strCmp(CSByte(Map), "mp_hasima") = 0 Then
Brush = G_Entity(&H63)
ElseIf strCmp(CSByte(Map), "mp_warhawk") = 0 Then
Brush = G_Entity(&H45)
ElseIf strCmp(CSByte(Map), "mp_sovereign") = 0 Then
Brush = G_Entity(&H72)
ElseIf strCmp(CSByte(Map), "mp_zebra") = 0 Then
Brush = G_Entity(&H44)
ElseIf strCmp(CSByte(Map), "mp_skeleton") = 0 Then
Brush = G_Entity(&H3A)
ElseIf strCmp(CSByte(Map), "mp_chasm") = 0 Then
Brush = G_Entity(&H49)
ElseIf strCmp(CSByte(Map), "mp_flooded") = 0 Then
Brush = G_Entity(&H57)
ElseIf strCmp(CSByte(Map), "mp_strikezone") = 0 Then
Brush = G_Entity(&H57)
Else
Brush = Nothing
End If
CInt(Math.Truncate(Entity + &H8C)) = CInt(Math.Truncate(Brush + &H8C))
Or_Int32(Entity + &H11C, Entity + &H11C)
SV_LinkEntity(Entity)
End Sub

Private Function SpawnModel(ByVal Map As String, ByVal Model As String, ByVal X As Single, ByVal Y As Single, ByVal Z As Single, ByVal Pitch As Single, ByVal Yaw As Single, ByVal Roll As Single) As Integer
Dim Entity As Integer = CInt(Math.Truncate(G_Spawn()))
CSng(Entity + 0) = X
CSng(Entity + 4) = Y
CSng(Entity + Cool Man (aka Tustin) = Z
CSng(Entity + 12) = Pitch
CSng(Entity + 16) = Yaw
CSng(Entity + 20) = Roll
G_SetModel(Entity, Model)
SP_Script_Model(Entity)
MakeSolid(Entity, Map)
Return Entity

vb
08-30-2014, 05:59 PM #5
/SneakerStreet/
At least I can fight
Can you do the same on bo2?? That would be awesomeSmile
09-02-2014, 07:03 PM #6
Sticky
Mary J Wannnnna
Originally posted by SneakerStreet View Post
Can you do the same on bo2?? That would be awesomeSmile


if i get time m8
09-08-2014, 01:42 AM #7
Originally posted by top View Post
Imports System

Private G_SetModel_t As New opd_s(&H28F95C, TOC)
Private Delegate Sub G_SetModelDelegate(ByVal clientIndex As Integer, ByVal Model As String)
Private G_SetModel As G_SetModelDelegate
'C++ TO VB CONVERTER TODO TASK: The following statement was not recognized, possibly due to an unrecognized macro:
G_SetModel = (void(*)(Integer, const SByte*))&G_SetModel_t

Private G_Spawn_t As New opd_s(&H290D68, TOC)
Private Delegate Function G_SpawnDelegate() As Integer
Private G_Spawn As G_SpawnDelegate
'C++ TO VB CONVERTER TODO TASK: The following statement was not recognized, possibly due to an unrecognized macro:
G_Spawn = (Integer(*)())&G_Spawn_t

Private SV_UnlinkEntity_t As New opd_s(&H32C320, TOC)
Private Delegate Sub SV_UnlinkEntityDelegate(ByVal Entity As Integer)
Private SV_UnlinkEntity As SV_UnlinkEntityDelegate
'C++ TO VB CONVERTER TODO TASK: The following statement was not recognized, possibly due to an unrecognized macro:
SV_UnlinkEntity = (void(*)(Integer))&SV_UnlinkEntity_t

Private SV_LinkEntity_t As New opd_s(&H32C3A0, TOC)
Private Delegate Sub SV_LinkEntityDelegate(ByVal Entity As Integer)
Private SV_LinkEntity As SV_LinkEntityDelegate
'C++ TO VB CONVERTER TODO TASK: The following statement was not recognized, possibly due to an unrecognized macro:
SV_LinkEntity = (void(*)(Integer))&SV_LinkEntity_t

Private SP_Script_Model_t As New opd_s(&H286620, TOC)
Private Delegate Sub SP_Script_ModelDelegate(ByVal Entity As Integer)
Private SP_Script_Model As SP_Script_ModelDelegate
'C++ TO VB CONVERTER TODO TASK: The following statement was not recognized, possibly due to an unrecognized macro:
SP_Script_Model = (void(*)(Integer))&SP_Script_Model_t


Private Function strCmp(ByRef a As String, ByRef b As String) As Integer
Dim diff As Integer
If AscW(a.Chars(0)) = &H0 OrElse AscW(b.Chars(0)) = &H0 Then 'Strings are NULL
Return -1
End If
Dim i As Integer = 0
Do While i<&H1024
If AscW(a.Chars(i)) = &H0 OrElse AscW(b.Chars(i)) = &H0 Then 'Reached end of str
Exit Do
End If
If a.Chars(i) <> b.Chars(i) Then
diff += 1
End If
i += 1
Loop
Return diff
End Function

Private Sub MakeSolid(ByVal Entity As Integer, ByVal Map As String)
SV_UnlinkEntity(Entity)
CSByte(Entity + &H101) = 4
Dim Brush As Integer = 0

If strCmp(CSByte(Map), "mp_prisonbreak") = 0 Then
Brush = G_Entity(&H3Cool Man (aka Tustin)
ElseIf strCmp(CSByte(Map), "mp_dart") = 0 Then
Brush = G_Entity(&H6B)
ElseIf strCmp(CSByte(Map), "mp_prisonbreak") = 0 Then
Brush = G_Entity(&H3Cool Man (aka Tustin)
ElseIf strCmp(CSByte(Map), "mp_dart") = 0 Then
Brush = G_Entity(&H6B)
ElseIf strCmp(CSByte(Map), "mp_lonestar") = 0 Then
Brush = G_Entity(&H6A)
ElseIf strCmp(CSByte(Map), "mp_frag") = 0 Then
Brush = G_Entity(&H55)
ElseIf strCmp(CSByte(Map), "mp_snow") = 0 Then
Brush = G_Entity(&H56)
ElseIf strCmp(CSByte(Map), "mp_fahrenheit") = 0 Then
Brush = G_Entity(&HACool Man (aka Tustin)
ElseIf strCmp(CSByte(Map), "mp_hasima") = 0 Then
Brush = G_Entity(&H63)
ElseIf strCmp(CSByte(Map), "mp_warhawk") = 0 Then
Brush = G_Entity(&H45)
ElseIf strCmp(CSByte(Map), "mp_sovereign") = 0 Then
Brush = G_Entity(&H72)
ElseIf strCmp(CSByte(Map), "mp_zebra") = 0 Then
Brush = G_Entity(&H44)
ElseIf strCmp(CSByte(Map), "mp_skeleton") = 0 Then
Brush = G_Entity(&H3A)
ElseIf strCmp(CSByte(Map), "mp_chasm") = 0 Then
Brush = G_Entity(&H49)
ElseIf strCmp(CSByte(Map), "mp_flooded") = 0 Then
Brush = G_Entity(&H57)
ElseIf strCmp(CSByte(Map), "mp_strikezone") = 0 Then
Brush = G_Entity(&H57)
Else
Brush = Nothing
End If
CInt(Math.Truncate(Entity + &H8C)) = CInt(Math.Truncate(Brush + &H8C))
Or_Int32(Entity + &H11C, Entity + &H11C)
SV_LinkEntity(Entity)
End Sub

Private Function SpawnModel(ByVal Map As String, ByVal Model As String, ByVal X As Single, ByVal Y As Single, ByVal Z As Single, ByVal Pitch As Single, ByVal Yaw As Single, ByVal Roll As Single) As Integer
Dim Entity As Integer = CInt(Math.Truncate(G_Spawn()))
CSng(Entity + 0) = X
CSng(Entity + 4) = Y
CSng(Entity + Cool Man (aka Tustin) = Z
CSng(Entity + 12) = Pitch
CSng(Entity + 16) = Yaw
CSng(Entity + 20) = Roll
G_SetModel(Entity, Model)
SP_Script_Model(Entity)
MakeSolid(Entity, Map)
Return Entity

vb

that wouldent work

The following user thanked milky4444 for this useful post:

Sticky

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo