Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Forum Support

    3. Suggestions

[V|REL|HOOK] LUA Plugin for Script Hook V


headscript
 Share

Recommended Posts

THANKS FOR THIS. going to try convert this ped = clone_ped(player_ped_id());

int group = get_player_group(player_id());

set_ped_as_group_member(ped, group);

task_combat_hated_targets_arou­nd_ped(0, 1000.0f, 0);

give_delayed_weapon_to_ped(ped­, Hash("weapon_pistol"));

set_ped_keep_task(ped, true);

Link to comment
Share on other sites

Can someone help guide me in the right direction? I'm using http://www.dev-c.com/nativedb/as a reference, but I'm having some trouble. How do I determine what arguments each reference is looking for?

 

edit.png void EXPLODE_VEHICLE(Any p0, Any p1, Any p2) // 0xBEDEACEB is what I'm trying to use, but I have no clue what p0, p1, and p2 are. Once it's called it does tell me I need all 3 and a boolean though.

Edited by Swarm96
Link to comment
Share on other sites

i'm just tinkering but i'm will get the bodyguard script

Edited by xsploit
Link to comment
Share on other sites

Aardvark2015

Before you butcher your code to get it smaller, try setting the compiler to optimize for size.

Also, it's a 3MB plugin for a 60GB game, who cares :p

Link to comment
Share on other sites

Can someone help guide me in the right direction? I'm using http://www.dev-c.com/nativedb/as a reference, but I'm having some trouble. How do I determine what arguments each reference is looking for?

 

edit.png void EXPLODE_VEHICLE(Any p0, Any p1, Any p2) // 0xBEDEACEB is what I'm trying to use, but I have no clue what p0, p1, and p2 are. Once it's called it does tell me I need all 3 and a boolean though.

 

p0 is the vehicle, p1 and p2 are probably two booleans.

 

try VEHICLE::EXPLODE_VEHICLE(veh, 1, 0);

Link to comment
Share on other sites

 

Can someone help guide me in the right direction? I'm using http://www.dev-c.com/nativedb/as a reference, but I'm having some trouble. How do I determine what arguments each reference is looking for?

 

edit.png void EXPLODE_VEHICLE(Any p0, Any p1, Any p2) // 0xBEDEACEB is what I'm trying to use, but I have no clue what p0, p1, and p2 are. Once it's called it does tell me I need all 3 and a boolean though.

 

p0 is the vehicle, p1 and p2 are probably two booleans.

 

try VEHICLE::EXPLODE_VEHICLE(veh, 1, 0);

 

Awesome, figured it out earlier and yes this is correct.

 

THANKS FOR THIS. going to try convert this ped = clone_ped(player_ped_id());

int group = get_player_group(player_id());

set_ped_as_group_member(ped, group);

task_combat_hated_targets_arou­nd_ped(0, 1000.0f, 0);

give_delayed_weapon_to_ped(ped­, Hash("weapon_pistol"));

set_ped_keep_task(ped, true);

Was trying to get this to work & got this far:

local ped = PED.CLONE_PED(PLAYER.PLAYER_PED_ID(), false, false, true)
local group = PLAYER.GET_PLAYER_GROUP(PLAYER.PLAYER_ID())
PED.SET_PED_AS_GROUP_MEMBER(1, group);
AI.TASK_COMBAT_HATED_TARGETS_AROUND_PED(0,1000,0)
WEAPON.GIVE_DELAYED_WEAPON_TO_PED(PED, Hash("weapon_pistol"))
I'm not really sure where to go with that last line. Anyone have ideas?
Link to comment
Share on other sites

Aardvark2015

While exploring the graphics and UI drawing functions with this - no reloading required :) - I noticed that anything I draw flickers on and off.

 

I can think of two reasons why this would be happening,

1) the script function is taking too long to execute, and gets out of sync with the game

2) the main tick() function is already called out of sync of the game's frames/ticks

 

I figured maybe reloading the testmodule.lua every tick could be too slow, but even putting the drawing code in the main tick instead of the reloading doesn't help.

Link to comment
Share on other sites

 

 

Can someone help guide me in the right direction? I'm using http://www.dev-c.com/nativedb/as a reference, but I'm having some trouble. How do I determine what arguments each reference is looking for?

 

edit.png void EXPLODE_VEHICLE(Any p0, Any p1, Any p2) // 0xBEDEACEB is what I'm trying to use, but I have no clue what p0, p1, and p2 are. Once it's called it does tell me I need all 3 and a boolean though.

 

p0 is the vehicle, p1 and p2 are probably two booleans.

 

try VEHICLE::EXPLODE_VEHICLE(veh, 1, 0);

 

Awesome, figured it out earlier and yes this is correct.

 

THANKS FOR THIS. going to try convert this ped = clone_ped(player_ped_id());

int group = get_player_group(player_id());

set_ped_as_group_member(ped, group);

task_combat_hated_targets_arou­nd_ped(0, 1000.0f, 0);

give_delayed_weapon_to_ped(ped­, Hash("weapon_pistol"));

set_ped_keep_task(ped, true);

Was trying to get this to work & got this far:

local ped = PED.CLONE_PED(PLAYER.PLAYER_PED_ID(), false, false, true)
local group = PLAYER.GET_PLAYER_GROUP(PLAYER.PLAYER_ID())
PED.SET_PED_AS_GROUP_MEMBER(1, group);
AI.TASK_COMBAT_HATED_TARGETS_AROUND_PED(0,1000,0)
WEAPON.GIVE_DELAYED_WEAPON_TO_PED(PED, Hash("weapon_pistol"))
I'm not really sure where to go with that last line. Anyone have ideas?

 

 

 

No not yet lol, loads a bunch of franklins

Link to comment
Share on other sites

 

 

 

Can someone help guide me in the right direction? I'm using http://www.dev-c.com/nativedb/as a reference, but I'm having some trouble. How do I determine what arguments each reference is looking for?

 

edit.png void EXPLODE_VEHICLE(Any p0, Any p1, Any p2) // 0xBEDEACEB is what I'm trying to use, but I have no clue what p0, p1, and p2 are. Once it's called it does tell me I need all 3 and a boolean though.

 

p0 is the vehicle, p1 and p2 are probably two booleans.

 

try VEHICLE::EXPLODE_VEHICLE(veh, 1, 0);

 

Awesome, figured it out earlier and yes this is correct.

 

THANKS FOR THIS. going to try convert this ped = clone_ped(player_ped_id());

int group = get_player_group(player_id());

set_ped_as_group_member(ped, group);

task_combat_hated_targets_arou­nd_ped(0, 1000.0f, 0);

give_delayed_weapon_to_ped(ped­, Hash("weapon_pistol"));

set_ped_keep_task(ped, true);

Was trying to get this to work & got this far:

local ped = PED.CLONE_PED(PLAYER.PLAYER_PED_ID(), false, false, true)
local group = PLAYER.GET_PLAYER_GROUP(PLAYER.PLAYER_ID())
PED.SET_PED_AS_GROUP_MEMBER(1, group);
AI.TASK_COMBAT_HATED_TARGETS_AROUND_PED(0,1000,0)
WEAPON.GIVE_DELAYED_WEAPON_TO_PED(PED, Hash("weapon_pistol"))
I'm not really sure where to go with that last line. Anyone have ideas?

 

 

 

No not yet lol, loads a bunch of franklins

 

Same here. No clue why. :/

Link to comment
Share on other sites



switch (activeLineIndexWeapon)
{
case 0:
for (int i = 0; i < sizeof(weaponNames) / sizeof(weaponNames[0]); i++)
WEAPON::GIVE_DELAYED_WEAPON_TO_PED(playerPed, GAMEPLAY::GET_HASH_KEY((char *)weaponNames[i]), 1000, 0);
set_status_text("all weapon added");
break;
// switchable features
default:
if (lines[activeLineIndexWeapon].pState)
*lines[activeLineIndexWeapon].pState = !(*lines[activeLineIndexWeapon].pState);
if (lines[activeLineIndexWeapon].pUpdated)
*lines[activeLineIndexWeapon].pUpdated = true;

static LPCSTR weaponNames[] = {

"WEAPON_KNIFE", "WEAPON_NIGHTSTICK", "WEAPON_HAMMER", "WEAPON_BAT", "WEAPON_GOLFCLUB", "WEAPON_CROWBAR",

"WEAPON_PISTOL", "WEAPON_COMBATPISTOL", "WEAPON_APPISTOL", "WEAPON_PISTOL50", "WEAPON_MICROSMG", "WEAPON_SMG",

"WEAPON_ASSAULTSMG", "WEAPON_ASSAULTRIFLE", "WEAPON_CARBINERIFLE", "WEAPON_ADVANCEDRIFLE", "WEAPON_MG",

"WEAPON_COMBATMG", "WEAPON_PUMPSHOTGUN", "WEAPON_SAWNOFFSHOTGUN", "WEAPON_ASSAULTSHOTGUN", "WEAPON_BULLPUPSHOTGUN",

"WEAPON_STUNGUN", "WEAPON_SNIPERRIFLE", "WEAPON_HEAVYSNIPER", "WEAPON_GRENADELAUNCHER", "WEAPON_GRENADELAUNCHER_SMOKE",

"WEAPON_RPG", "WEAPON_MINIGUN", "WEAPON_GRENADE", "WEAPON_STICKYBOMB", "WEAPON_SMOKEGRENADE", "WEAPON_BZGAS",

"WEAPON_MOLOTOV", "WEAPON_FIREEXTINGUISHER", "WEAPON_PETROLCAN",

"WEAPON_SNSPISTOL", "WEAPON_SPECIALCARBINE", "WEAPON_HEAVYPISTOL", "WEAPON_BULLPUPRIFLE", "WEAPON_HOMINGLAUNCHER",

"WEAPON_PROXMINE", "WEAPON_SNOWBALL", "WEAPON_VINTAGEPISTOL", "WEAPON_DAGGER", "WEAPON_FIREWORK", "WEAPON_MUSKET",

"WEAPON_MARKSMANRIFLE", "WEAPON_HEAVYSHOTGUN", "WEAPON_GUSENBERG", "WEAPON_HATCHET", "WEAPON_RAILGUN"


in the trainer there is a table list


Edited by xsploit
Link to comment
Share on other sites

Was trying to get this to work & got this far:

local ped = PED.CLONE_PED(PLAYER.PLAYER_PED_ID(), false, false, true)

local group = PLAYER.GET_PLAYER_GROUP(PLAYER.PLAYER_ID())

PED.SET_PED_AS_GROUP_MEMBER(1, group);

AI.TASK_COMBAT_HATED_TARGETS_AROUND_PED(0,1000,0)

WEAPON.GIVE_DELAYED_WEAPON_TO_PED(PED, Hash("weapon_pistol"))

 

I'm not really sure where to go with that last line. Anyone have ideas?

The give weapon needs 2 extra arguments not sure what they are but it works fine here:

 

local playerPed = PLAYER.PLAYER_PED_ID();    local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);    local clone = PED.CLONE_PED(playerPed, coords.x, coords.y, coords.z);    local group = PLAYER.GET_PLAYER_GROUP(PLAYER.PLAYER_ID());    PED.SET_PED_AS_GROUP_MEMBER(clone, group);    AI.TASK_COMBAT_HATED_TARGETS_AROUND_PED(clone, 5000, 0);    PED.SET_PED_KEEP_TASK(clone, true);    WEAPON.GIVE_DELAYED_WEAPON_TO_PED(clone, GAMEPLAY.GET_HASH_KEY("weapon_pistol"), 1000, true);    ENTITY.SET_ENTITY_INVINCIBLE(clone, false);
Edited by DakotaCSS
Link to comment
Share on other sites

 

Was trying to get this to work & got this far:

local ped = PED.CLONE_PED(PLAYER.PLAYER_PED_ID(), false, false, true)

local group = PLAYER.GET_PLAYER_GROUP(PLAYER.PLAYER_ID())

PED.SET_PED_AS_GROUP_MEMBER(1, group);

AI.TASK_COMBAT_HATED_TARGETS_AROUND_PED(0,1000,0)

WEAPON.GIVE_DELAYED_WEAPON_TO_PED(PED, Hash("weapon_pistol"))

 

I'm not really sure where to go with that last line. Anyone have ideas?

The give weapon needs 2 extra arguments not sure what they are but it works fine here:

 

local playerPed = PLAYER.PLAYER_PED_ID();    local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);    local clone = PED.CLONE_PED(playerPed, coords.x, coords.y, coords.z);    local group = PLAYER.GET_PLAYER_GROUP(PLAYER.PLAYER_ID());    PED.SET_PED_AS_GROUP_MEMBER(clone, group);    AI.TASK_COMBAT_HATED_TARGETS_AROUND_PED(clone, 5000, 0);    PED.SET_PED_KEEP_TASK(clone, true);    WEAPON.GIVE_DELAYED_WEAPON_TO_PED(clone, GAMEPLAY.GET_HASH_KEY("weapon_pistol"), 1000, true);    ENTITY.SET_ENTITY_INVINCIBLE(clone, false);

Awesome dude. Any way to make the clones not of your character haha?

Link to comment
Share on other sites


 

tick: scripts/testmodule.lua:17: error in function 'GIVE_DELAYED_WEAPON_TO_PED'.

 

argument #1 is 'table'; 'number' expected.

 

tick: scripts/testmodule.lua:17: error in function 'GIVE_DELAYED_WEAPON_TO_PED'.

 

argument #1 is 'table'; 'number' expected.

THATS THE ERROR I GET

 

Link to comment
Share on other sites

While exploring the graphics and UI drawing functions with this - no reloading required :) - I noticed that anything I draw flickers on and off.

 

I can think of two reasons why this would be happening,

1) the script function is taking too long to execute, and gets out of sync with the game

2) the main tick() function is already called out of sync of the game's frames/ticks

 

I figured maybe reloading the testmodule.lua every tick could be too slow, but even putting the drawing code in the main tick instead of the reloading doesn't help.

tick is only called every 50ms to not lower the game fps but i can try to set it to 0 which i havent tried but the native trainer uses

 

 

tick: scripts/testmodule.lua:17: error in function 'GIVE_DELAYED_WEAPON_TO_PED'.     argument #1 is 'table'; 'number' expected.tick: scripts/testmodule.lua:17: error in function 'GIVE_DELAYED_WEAPON_TO_PED'.     argument #1 is 'table'; 'number' expected.THATS THE ERROR I GET

Show me your exact line you trying to do

 

 

 

Was trying to get this to work & got this far:

local ped = PED.CLONE_PED(PLAYER.PLAYER_PED_ID(), false, false, true)

local group = PLAYER.GET_PLAYER_GROUP(PLAYER.PLAYER_ID())

PED.SET_PED_AS_GROUP_MEMBER(1, group);

AI.TASK_COMBAT_HATED_TARGETS_AROUND_PED(0,1000,0)

WEAPON.GIVE_DELAYED_WEAPON_TO_PED(PED, Hash("weapon_pistol"))

 

I'm not really sure where to go with that last line. Anyone have ideas?

The give weapon needs 2 extra arguments not sure what they are but it works fine here:

 

local playerPed = PLAYER.PLAYER_PED_ID();    local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);    local clone = PED.CLONE_PED(playerPed, coords.x, coords.y, coords.z);    local group = PLAYER.GET_PLAYER_GROUP(PLAYER.PLAYER_ID());    PED.SET_PED_AS_GROUP_MEMBER(clone, group);    AI.TASK_COMBAT_HATED_TARGETS_AROUND_PED(clone, 5000, 0);    PED.SET_PED_KEEP_TASK(clone, true);    WEAPON.GIVE_DELAYED_WEAPON_TO_PED(clone, GAMEPLAY.GET_HASH_KEY("weapon_pistol"), 1000, true);    ENTITY.SET_ENTITY_INVINCIBLE(clone, false);

Awesome dude. Any way to make the clones not of your character haha?

 

PED.CREATE_RANDOM_PED( Position.x, Position.y, Position.z)

 

Can someone help guide me in the right direction? I'm using http://www.dev-c.com/nativedb/as a reference, but I'm having some trouble. How do I determine what arguments each reference is looking for?

 

edit.png void EXPLODE_VEHICLE(Any p0, Any p1, Any p2) // 0xBEDEACEB is what I'm trying to use, but I have no clue what p0, p1, and p2 are. Once it's called it does tell me I need all 3 and a boolean though.

 

someohow the natives.h which was released in the sdk is different to the nativedb (both are not right so i dont know which i should use right now i still stick to the sdk ones)

Link to comment
Share on other sites

 

While exploring the graphics and UI drawing functions with this - no reloading required :) - I noticed that anything I draw flickers on and off.

 

I can think of two reasons why this would be happening,

1) the script function is taking too long to execute, and gets out of sync with the game

2) the main tick() function is already called out of sync of the game's frames/ticks

 

I figured maybe reloading the testmodule.lua every tick could be too slow, but even putting the drawing code in the main tick instead of the reloading doesn't help.

tick is only called every 50ms to not lower the game fps but i can try to set it to 0 which i havent tried but the native trainer uses

 

 

tick: scripts/testmodule.lua:17: error in function 'GIVE_DELAYED_WEAPON_TO_PED'.     argument #1 is 'table'; 'number' expected.tick: scripts/testmodule.lua:17: error in function 'GIVE_DELAYED_WEAPON_TO_PED'.     argument #1 is 'table'; 'number' expected.THATS THE ERROR I GET

Show me your exact line you trying to do

 

 

 

Was trying to get this to work & got this far:

local ped = PED.CLONE_PED(PLAYER.PLAYER_PED_ID(), false, false, true)

local group = PLAYER.GET_PLAYER_GROUP(PLAYER.PLAYER_ID())

PED.SET_PED_AS_GROUP_MEMBER(1, group);

AI.TASK_COMBAT_HATED_TARGETS_AROUND_PED(0,1000,0)

WEAPON.GIVE_DELAYED_WEAPON_TO_PED(PED, Hash("weapon_pistol"))

 

I'm not really sure where to go with that last line. Anyone have ideas?

The give weapon needs 2 extra arguments not sure what they are but it works fine here:

 

local playerPed = PLAYER.PLAYER_PED_ID();    local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);    local clone = PED.CLONE_PED(playerPed, coords.x, coords.y, coords.z);    local group = PLAYER.GET_PLAYER_GROUP(PLAYER.PLAYER_ID());    PED.SET_PED_AS_GROUP_MEMBER(clone, group);    AI.TASK_COMBAT_HATED_TARGETS_AROUND_PED(clone, 5000, 0);    PED.SET_PED_KEEP_TASK(clone, true);    WEAPON.GIVE_DELAYED_WEAPON_TO_PED(clone, GAMEPLAY.GET_HASH_KEY("weapon_pistol"), 1000, true);    ENTITY.SET_ENTITY_INVINCIBLE(clone, false);

Awesome dude. Any way to make the clones not of your character haha?

 

PED.CREATE_RANDOM_PED( Position.x, Position.y, Position.z)

 

Can someone help guide me in the right direction? I'm using http://www.dev-c.com/nativedb/as a reference, but I'm having some trouble. How do I determine what arguments each reference is looking for?

 

edit.png void EXPLODE_VEHICLE(Any p0, Any p1, Any p2) // 0xBEDEACEB is what I'm trying to use, but I have no clue what p0, p1, and p2 are. Once it's called it does tell me I need all 3 and a boolean though.

 

someohow the natives.h which was released in the sdk is different to the nativedb (both are not right so i dont know which i should use right now i still stick to the sdk ones)

 

local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);
local clone = PED.CREATE_RANDOM_PED(coords.x, coords.y, coords.z);
Should work, no? It just tells me that when I call coords in the second line, they aren't numbers.
Link to comment
Share on other sites

local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);

local clone = PED.CREATE_RANDOM_PED(coords.x, coords.y, coords.z);
Should work, no? It just tells me that when I call coords in the second line, they aren't numbers.

 

update your plugin i forgot to add vector support in this version sorry

Edited by headscript
Link to comment
Share on other sites

XBLToothPik

 

While exploring the graphics and UI drawing functions with this - no reloading required :) - I noticed that anything I draw flickers on and off.

 

I can think of two reasons why this would be happening,

1) the script function is taking too long to execute, and gets out of sync with the game

2) the main tick() function is already called out of sync of the game's frames/ticks

 

I figured maybe reloading the testmodule.lua every tick could be too slow, but even putting the drawing code in the main tick instead of the reloading doesn't help.

tick is only called every 50ms to not lower the game fps but i can try to set it to 0 which i havent tried but the native trainer uses

 

I don't think bringing it down to 0 ms would make it lag any, the script hook is all threaded just as the game is, should run just fine.

 

Also, on the side of a 3+MB .ASI file, did you set the target of the VS project to RELEASE? DEBUG outputs are much larger.

Link to comment
Share on other sites

 

I don't think bringing it down to 0 ms would make it lag any, the script hook is all threaded just as the game is, should run just fine.

 

Also, on the side of a 3+MB .ASI file, did you set the target of the VS project to RELEASE? DEBUG outputs are much larger.

 

http://puu.sh/hraRy/7faf20798f.png

http://puu.sh/hraSc/1a88907c9f.png

http://puu.sh/hraSK/c74a8208c2.png

Link to comment
Share on other sites

 

local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);

local clone = PED.CREATE_RANDOM_PED(coords.x, coords.y, coords.z);
Should work, no? It just tells me that when I call coords in the second line, they aren't numbers.

 

update your plugin i forgot to add vector support in this version sorry

 

I still get an error. It says:

tick: scripts/testmodule.lua:12: error in function 'CREATE_RANDOM_PED'.

argument #1 is 'Vector3'; 'number' expected.

 

Any ideas? Is my code wrong?

Link to comment
Share on other sites

 

 

local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);

local clone = PED.CREATE_RANDOM_PED(coords.x, coords.y, coords.z);
Should work, no? It just tells me that when I call coords in the second line, they aren't numbers.

 

update your plugin i forgot to add vector support in this version sorry

 

I still get an error. It says:

tick: scripts/testmodule.lua:12: error in function 'CREATE_RANDOM_PED'.

argument #1 is 'Vector3'; 'number' expected.

 

Any ideas? Is my code wrong?

 

tick: scripts/testmodule.lua:12: error in function 'CREATE_RANDOM_PED'.

argument #1 is 'Vector3'; 'number' expected.

u got to input vector.x vector.y vector.z

Link to comment
Share on other sites

So, no clue why but it just decided to work. http://i.imgur.com/ihLoznG.jpg! Hahah! here is the full code for anyone who's interested: http://pastebin.com/w5DbK2uq Just press F3 to spawn them!

if you want to spawn zombies

http://puu.sh/hrbZW/8a8761a2c1.png

local zombieSkinID = GAMEPLAY.GET_HASH_KEY("u_m_y_zombie_01")

PED.CREATE_PED( 26,zombieSkinID,x, y, z,0,true,true)

Link to comment
Share on other sites

 

So, no clue why but it just decided to work. http://i.imgur.com/ihLoznG.jpg! Hahah! here is the full code for anyone who's interested: http://pastebin.com/w5DbK2uq Just press F3 to spawn them!

if you want to spawn zombies

http://puu.sh/hrbZW/8a8761a2c1.png

local zombieSkinID = GAMEPLAY.GET_HASH_KEY("u_m_y_zombie_01")

PED.CREATE_PED( 26,zombieSkinID,x, y, z,0,true,true)

 

Could you explain a little bit whats happening in this line? I'm not sure I understand it: local zombieSkinID = GAMEPLAY.GET_HASH_KEY("u_m_y_zombie_01")

 

How would I go about spawning other specific characters?

Link to comment
Share on other sites

 

So, no clue why but it just decided to work. http://i.imgur.com/ihLoznG.jpg! Hahah! here is the full code for anyone who's interested: http://pastebin.com/w5DbK2uq Just press F3 to spawn them!

if you want to spawn zombies

http://puu.sh/hrbZW/8a8761a2c1.png

local zombieSkinID = GAMEPLAY.GET_HASH_KEY("u_m_y_zombie_01")

PED.CREATE_PED( 26,zombieSkinID,x, y, z,0,true,true)

 

can you post the whole code i can't get create ped to work on anything i did however got the clone to work..

 

But if i can createped, then i already set clones as cops, they look like franklin but can kill you. so if i just set the zombies to cops and they have no weapons. can sorta make a zombieish mof

Edited by xsploit
Link to comment
Share on other sites

 

 

So, no clue why but it just decided to work. http://i.imgur.com/ihLoznG.jpg! Hahah! here is the full code for anyone who's interested: http://pastebin.com/w5DbK2uq Just press F3 to spawn them!

if you want to spawn zombies

http://puu.sh/hrbZW/8a8761a2c1.png

local zombieSkinID = GAMEPLAY.GET_HASH_KEY("u_m_y_zombie_01")

PED.CREATE_PED( 26,zombieSkinID,x, y, z,0,true,true)

 

can you post the whole code i can't get create ped to work on anything i did however got the clone to work

 

local testmodule = {}testmodule.loaded = falsefunction testmodule.tick()	if(not testmodule.loaded) then 		local zombieSkinID = GAMEPLAY.GET_HASH_KEY("u_m_y_zombie_01")		local playerPed = PLAYER.PLAYER_PED_ID()		local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)		local playerPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)		while(not STREAMING.HAS_MODEL_LOADED(zombieSkinID)) do				--wait(5) wait function not yet implemented in released version		end		for i = 0 ,10,1 do						PED.CREATE_PED( 26,zombieSkinID,playerPosition.x, playerPosition.y, playerPosition.z,0,true,true)					end		STREAMING.SET_MODEL_AS_NO_LONGER_NEEDED(zombieSkinID)		testmodule.loaded = true	end    --print("Hello World! 2")	endreturn testmodule
Link to comment
Share on other sites

XBLToothPik

 

 

I don't think bringing it down to 0 ms would make it lag any, the script hook is all threaded just as the game is, should run just fine.

 

Also, on the side of a 3+MB .ASI file, did you set the target of the VS project to RELEASE? DEBUG outputs are much larger.

 

http://puu.sh/hraRy/7faf20798f.png

http://puu.sh/hraSc/1a88907c9f.png

http://puu.sh/hraSK/c74a8208c2.png

 

 

I mean up at the top of the window. Here:

http://puu.sh/hrcx5/f103ff5154.png

Link to comment
Share on other sites

 

Would it be possible for you to add a Lua console to this mod, so you don't need to restart the game and wait for it to load every time you want to try something new?

dont u see a console when u join a game?

you cant type anything in but if error occurs u see them there and u can reload your own lua files easily with lua builtin functions

 

 

Thanks for this tool, headscript.

 

Could you please explain briefly how to reload the lua files in-game?

Link to comment
Share on other sites

 

 

 

So, no clue why but it just decided to work. http://i.imgur.com/ihLoznG.jpg! Hahah! here is the full code for anyone who's interested: http://pastebin.com/w5DbK2uq Just press F3 to spawn them!

if you want to spawn zombies

http://puu.sh/hrbZW/8a8761a2c1.png

local zombieSkinID = GAMEPLAY.GET_HASH_KEY("u_m_y_zombie_01")

PED.CREATE_PED( 26,zombieSkinID,x, y, z,0,true,true)

 

can you post the whole code i can't get create ped to work on anything i did however got the clone to work

 

local testmodule = {}testmodule.loaded = falsefunction testmodule.tick()	if(not testmodule.loaded) then 		local zombieSkinID = GAMEPLAY.GET_HASH_KEY("u_m_y_zombie_01")		local playerPed = PLAYER.PLAYER_PED_ID()		local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)		local playerPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)		while(not STREAMING.HAS_MODEL_LOADED(zombieSkinID)) do				--wait(5) wait function not yet implemented in released version		end		for i = 0 ,10,1 do						PED.CREATE_PED( 26,zombieSkinID,playerPosition.x, playerPosition.y, playerPosition.z,0,true,true)					end		STREAMING.SET_MODEL_AS_NO_LONGER_NEEDED(zombieSkinID)		testmodule.loaded = true	end    --print("Hello World! 2")	endreturn testmodule

I keep getting this

tick: scripts/testmodule.lua:11: error in function 'CREATE_PED'.
argument #3 is 'nil'; 'number' expected.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.