mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-01-03 16:13:34 +08:00
[saco] Implement/match CActorPed constructor
This commit is contained in:
parent
a99e62029f
commit
94bfbc8947
36
saco/game/actorped.cpp
Normal file
36
saco/game/actorped.cpp
Normal file
@ -0,0 +1,36 @@
|
||||
|
||||
#include "../main.h"
|
||||
#include "game.h"
|
||||
#include "util.h"
|
||||
|
||||
extern CGame *pGame;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// This is the constructor for creating new player.
|
||||
|
||||
CActorPed::CActorPed(int iSkin, float fX, float fY,float fZ,float fRotation)
|
||||
{
|
||||
m_pPed=0;
|
||||
m_dwGTAId=0;
|
||||
m_byteImmune=0;
|
||||
int iCounter=0;
|
||||
DWORD dwActorID=0;
|
||||
|
||||
if(!pGame->IsModelLoaded(iSkin)) {
|
||||
pGame->RequestModel(iSkin);
|
||||
pGame->LoadRequestedModels();
|
||||
while(!pGame->IsModelLoaded(iSkin)) Sleep(1);
|
||||
}
|
||||
|
||||
ScriptCommand(&create_actor,5,iSkin,fX,fY,fZ-1.0f,&dwActorID);
|
||||
ScriptCommand(&set_actor_z_angle,dwActorID,fRotation);
|
||||
|
||||
m_dwGTAId = dwActorID;
|
||||
m_pPed = GamePool_Ped_GetAt(m_dwGTAId);
|
||||
m_pEntity = (ENTITY_TYPE *)m_pPed;
|
||||
ScriptCommand(&set_actor_can_be_decapitated,m_dwGTAId,0);
|
||||
ScriptCommand(&set_actor_dicision,m_dwGTAId,65542);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
19
saco/game/actorped.h
Normal file
19
saco/game/actorped.h
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
class CActorPed : public CEntity
|
||||
{
|
||||
public:
|
||||
// Constructor/Destructor.
|
||||
CActorPed(int iSkin, float fPosX, float fPosY, float fPosZ, float fRotation = 0.0f);
|
||||
|
||||
PED_TYPE *m_pPed;
|
||||
DWORD m_dwMarkerID;
|
||||
DWORD m_dwArrow;
|
||||
BYTE m_byteCreateMarker;
|
||||
BYTE m_byteImmune;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------
|
@ -32,6 +32,8 @@ int ScriptCommand(const SCRIPT_COMMAND* pScriptCommand, ...); // The main script
|
||||
const SCRIPT_COMMAND request_model = { 0x0247, "i" }; // (CAR_*|BIKE_*|BOAT_*|WEAPON_*|OBJECT_*)
|
||||
const SCRIPT_COMMAND load_requested_models = { 0x038B, "" }; // -/-
|
||||
|
||||
const SCRIPT_COMMAND create_actor = { 0x009A, "iifffv" }; // PEDTYPE_*, #MODEL, x, y, z, var_actor
|
||||
|
||||
const SCRIPT_COMMAND fade = { 0x016A, "ii" }; // (time in ms), FADE_*
|
||||
|
||||
const SCRIPT_COMMAND set_current_time = { 0x00C0, "ii" }; // Hours, Minutes
|
||||
@ -109,6 +111,8 @@ const SCRIPT_COMMAND set_panel_row_enable = { 0x08D9, "iii" };
|
||||
|
||||
const SCRIPT_COMMAND get_panel_active_row = { 0x08D7, "iv" };
|
||||
|
||||
const SCRIPT_COMMAND set_actor_dicision = { 0x60B, "ii" };
|
||||
|
||||
const SCRIPT_COMMAND set_player_drunk_visuals = { 0x052c, "ii" }; // player, severity (0-255)
|
||||
const SCRIPT_COMMAND handling_responsiveness = { 0x03fd, "ii" }; // player, severity (0-255)
|
||||
|
||||
|
@ -129,6 +129,12 @@
|
||||
<Filter
|
||||
Name="game"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath=".\game\actorped.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\game\actorped.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\game\address.h">
|
||||
</File>
|
||||
|
Loading…
x
Reference in New Issue
Block a user