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

    1. GTANet.com

    1. GTA Online

      1. The Contract
      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. Support

    3. Suggestions

[Q]Player_ped_id


no_lifer
 Share

Recommended Posts

First of all : i'm already reading this forum for a while and i think people are really nice and really helping people instead of bully them.

 

but i got a few questions:

 

I made a system to get the player list and get the name out the output for that is : selectedPlayer.

That work for things like :

 

if (PED::IS_PED_IN_ANY_VEHICLE(selectedPlayer, 0));
But if you do:

 

(PLAYER::PLAYER_PED_ID(selectedPlayer));
isn't working but how do i got the ID ?.

 

Second i wanna print the wanted level of someone in my menu, i tried :

 

drawNotification(GET_PLAYER_WANTED_LEVEL(selectedPlayer); 
but than it says a int is incompatible with parameter of type char*

 

third:

I wanna put the option in to make custom license plate's but i don't know how to do that they can put in the name themselves.

Edited by no_lifer
Link to comment
Share on other sites

Use PLAYER::GET_PLAYER_PED to get the ped of a player.

if (PED::IS_PED_IN_ANY_VEHICLE(PLAYER:GET_PLAYER_PED(selectedPlayer), 0)){ //...}

Use std::to_string to convert the integer returned by GET_PLAYER_WANTED_LEVEL to a string, then .c_str() to convert that to a char*.

drawNotification(std::to_string(GET_PLAYER_WANTED_LEVEL(selectedPlayer)).c_str());

P.S. You need to add #include <string> in your code to use std::to_string.

 

Here is some code for displaying an onscreen keyboard for changing the licence plate text.

Edited by LetsPlayOrDy
Link to comment
Share on other sites

Learn the basics of C++ before modding, please...

i got a my script almost done but don't know a few things and than a guy like this with 0 answers show up.

Thanks man, You are a really good helper i think everybody learns by asking questions and people who know stuff can answer.

Please... don't waste your time with this sh*t .... if i look at your answers than they are or crap or not the best solution so sst before talking about other people.

 

And really much thanks to LetsPlayOrDy, A guy who is nice and is helping!, best wishes for 2016 mate!

Edited by no_lifer
Link to comment
Share on other sites

You don't have to learn the basics of C++ before modding, but C++ is, you know, a hardcore programming language in which you actually have to manually request memory from the operating system when you'd like to store something and you must manually release it later when you're done in order to avoid memory leaks - that is only an example, but it clearly indicates C/C++ isn't exactly for newbies. C/C++ is well suited for operating systems and games - not well suited for somebody tinkering with something they don't fully understand. For example, you seem to be using (PLAYER::PLAYER_PED_ID(selectedPlayer)) incorrectly - I have't looked at the interface for that call, but it looks like you don't fully grasp return values in C. If you don't get that, you're gonna get confused - you may think you're just "modding," but you're actually using a real programming language that was designed in the 70s for low level control of the operating system.

OP, I learned C/C++ as my first programming language - and I do not use it in my GTA mods (not saying you shouldn't, but I don't) - I use the RagePluginHook.

http://ragepluginhook.net/

look at some of the examples in the SDK folder in the download package for the RagePluginHook, I think you'll find the interface is far easier to use. C# is a far more forgiving language (though not necessarily superior to) than C/C++, and the type hinting in Visual Studio will make it a lot easier developing mods for GTA.

 

There's also the ScriptHookVDotNet, which I used in the beginning - it was pretty awesome, and open source, but RPH blows it away in terms of features, functionality, and presentation.

 

Just my thoughts - I'm not hating on the OP, everyone's got to start modding/programming somewhere - but based on what seems to be your knowledge of C++, you might find it much easier to try one of the C# script hooks.

Edited by Ethenal
  • Like 3
Link to comment
Share on other sites

You don't have to learn the basics of C++ before modding, but C++ is, you know, a hardcore programming language in which you actually have to manually request memory from the operating system when you'd like to store something and you must manually release it later when you're done in order to avoid memory leaks - that is only an example, but it clearly indicates C/C++ isn't exactly for newbies. C/C++ is well suited for operating systems and games - not well suited for somebody tinkering with something they don't fully understand. For example, you seem to be using (PLAYER::PLAYER_PED_ID(selectedPlayer)) incorrectly - I have't looked at the interface for that call, but it looks like you don't fully grasp return values in C. If you don't get that, you're gonna get confused - you may think you're just "modding," but you're actually using a real programming language that was designed in the 70s for low level control of the operating system.

 

OP, I learned C/C++ as my first programming language - and I do not use it in my GTA mods (not saying you shouldn't, but I don't) - I use the RagePluginHook.

 

http://ragepluginhook.net/

 

look at some of the examples in the SDK folder in the download package for the RagePluginHook, I think you'll find the interface is far easier to use. C# is a far more forgiving language (though not necessarily superior to) than C/C++, and the type hinting in Visual Studio will make it a lot easier developing mods for GTA.

 

There's also the ScriptHookVDotNet, which I used in the beginning - it was pretty awesome, and open source, but RPH blows it away in terms of features, functionality, and presentation.

 

Just my thoughts - I'm not hating on the OP, everyone's got to start modding/programming somewhere - but based on what seems to be your knowledge of C++, you might find it much easier to try one of the C# script hooks.

Still, there are a lot of good mods for ScripthookVDotNet:

gtaxscripting.blogspot.com

Link to comment
Share on other sites

Yeah like I said, I used the ScriptHookVDotNet in the beginning, it's quite good - it's also a bonus that it's open source, because you can actually see what natives they call in their code in order to produce the desired results for their API.

 

It's rather similar to RPH, really - I used RPH because I play LSPDFR - I didn't find out until later that it's actually a pretty great programming tool.

Link to comment
Share on other sites

Ethenal, i understand what you mean and will look in to it :),

The answer where wrong but that's because the Native's are else than i thought so it was :(PLAYER:GET_PLAYER_PED(selectedPlayer)

almost the same but another question.

 

again i gonna look in to it an thanks same for ahk1221! :)

Link to comment
Share on other sites

 

Learn the basics of C++ before modding, please...

i got a my script almost done but don't know a few things and than a guy like this with 0 answers show up.

Thanks man, You are a really good helper i think everybody learns by asking questions and people who know stuff can answer.

Please... don't waste your time with this sh*t .... if i look at your answers than they are or crap or not the best solution so sst before talking about other people.

 

And really much thanks to LetsPlayOrDy, A guy who is nice and is helping!, best wishes for 2016 mate!

 

Sorry but you should know the difference between int and char*...

AND that PLAYER_PED_ID() returns the ID of YOUR current ped model and has no params!

Link to comment
Share on other sites

Yeah like I said, I used the ScriptHookVDotNet in the beginning, it's quite good - it's also a bonus that it's open source, because you can actually see what natives they call in their code in order to produce the desired results for their API.

 

It's rather similar to RPH, really - I used RPH because I play LSPDFR - I didn't find out until later that it's actually a pretty great programming tool.

Yeah, it may be better, but there's a whole big community for ScriptHookVDotNet and lots of cool mods. Apart from the RAGEHook Trainer, the spike strips and LSPDFR, I haven't seen any other mods for RAGEHookPlugin (I get why you use RPH instead of RAGEHo... arghhhhh forget it)

Link to comment
Share on other sites

 

 

Learn the basics of C++ before modding, please...

i got a my script almost done but don't know a few things and than a guy like this with 0 answers show up.

Thanks man, You are a really good helper i think everybody learns by asking questions and people who know stuff can answer.

Please... don't waste your time with this sh*t .... if i look at your answers than they are or crap or not the best solution so sst before talking about other people.

 

And really much thanks to LetsPlayOrDy, A guy who is nice and is helping!, best wishes for 2016 mate!

 

Sorry but you should know the difference between int and char*...

AND that PLAYER_PED_ID() returns the ID of YOUR current ped model and has no params!

 

PLAYER_PED_ID returns your ped's handle. Each entity in the GTA(Don't know about first and second games) worlds has an handle, whatever that would be player handle, ped handle, vehicle handle, pickup handle and so on... If this function would return what you said, it wouldn't work well. You can read more about handles in RagePluginHook website, MulleDK19 explained that.
AHK1221,
What is wrong with name ? RAGE - is the name of the GTA IV, Max Payne 3, RDR, GTA V game engine. PluginHook - is because it hooks external script onto engines normal scripts.
All the best,
Paul
Edited by leftas
Link to comment
Share on other sites

 

 

 

Learn the basics of C++ before modding, please...

 

i got a my script almost done but don't know a few things and than a guy like this with 0 answers show up.

Thanks man, You are a really good helper i think everybody learns by asking questions and people who know stuff can answer.

Please... don't waste your time with this sh*t .... if i look at your answers than they are or crap or not the best solution so sst before talking about other people.

And really much thanks to LetsPlayOrDy, A guy who is nice and is helping!, best wishes for 2016 mate!

 

Sorry but you should know the difference between int and char*...

AND that PLAYER_PED_ID() returns the ID of YOUR current ped model and has no params!

 

PLAYER_PED_ID returns your ped's handle. Each entity in the GTA(Don't know about first and second games) worlds has an handle, whatever that would be player handle, ped handle, vehicle handle, pickup handle and so on... If this function would return what you said, it wouldn't work well. You can read more about handles in RagePluginHook website, MulleDK19 explained that.

 

AHK1221,

What is wrong with name ? RAGE - is the name of the GTA IV, Max Payne 3, RDR, GTA V game engine. PluginHook - is because it hooks external script onto engines normal scripts.

 

All the best,

Paul

Nothings wrong with it, it's just too long. And I know all HD games use the RAGE engine. Edited by AHK1221
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.