Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

headscript

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

Recommended Posts

xsploit

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);

Share this post


Link to post
Share on other sites
Swarm96

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

Share this post


Link to post
Share on other sites
xsploit

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

Edited by xsploit

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Aleph-Zero

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);

Share this post


Link to post
Share on other sites
Swarm96

 

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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
xsploit

 

 

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

Share this post


Link to post
Share on other sites
Swarm96

 

 

 

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. :/

Share this post


Link to post
Share on other sites
xsploit


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

Share this post


Link to post
Share on other sites
DakotaCSS

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

Share this post


Link to post
Share on other sites
Swarm96

 

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?

Share this post


Link to post
Share on other sites
xsploit


 

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

 

Share this post


Link to post
Share on other sites
headscript

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)

Share this post


Link to post
Share on other sites
Swarm96

 

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.

Share this post


Link to post
Share on other sites
headscript

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
headscript

 

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

Share this post


Link to post
Share on other sites
Swarm96

 

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?

Share this post


Link to post
Share on other sites
xsploit

Ok, It's working now if i can just spawn peds with the zombie model

Share this post


Link to post
Share on other sites
headscript

 

 

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

Share this post


Link to post
Share on other sites
headscript

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)

Share this post


Link to post
Share on other sites
Swarm96

 

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?

Share this post


Link to post
Share on other sites
xsploit

 

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

Share this post


Link to post
Share on other sites
headscript

 

 

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
headscript

 

 

 

 

 

 

 

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

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

 

x64 release ofc

Edited by headscript

Share this post


Link to post
Share on other sites
antd

 

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?

Share this post


Link to post
Share on other sites
xsploit

 

 

 

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 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.