earwaxking Posted July 13, 2015 Share Posted July 13, 2015 (edited) Hello, so I am working on a Lua script that has separate features for each player (Franklin, Trevor, Micheal). I have most of it ready however I haven't managed to figure out how to check who I'm playing as. For instance say I want Trevor to be able to scare certain npcs away from him, but I don't want Franklin to be able to do that. How do I set up the statement to check I'm playing as Trevor but not Franklin or Michael? Pseudo: If playerID = Trevor then Flee npc Else if Do nothing Edited July 13, 2015 by earwaxking Link to comment Share on other sites More sharing options...
InfamousSabre Posted July 13, 2015 Share Posted July 13, 2015 check the player ped's model Link to comment Share on other sites More sharing options...
earwaxking Posted July 14, 2015 Author Share Posted July 14, 2015 (edited) check the player ped's model That is what I'm doing or so I thought since it is not working for me. Im checking the ID with local playerID = PLAYER.PLAYER_ID()local player = PLAYER.GET_PLAYER_PED(playerID)local playerPedID = PLAYER.PLAYER_PED_ID(player) Then in my if statment im checking that playerID is equal to the corresponding player value, Which I beleive is 1 for Micheal, 2 for Frankling, and 3 for Trevor. Forgive me if this is a very simple question. I am new to modding with Lua and there is very short supply on tutorials so ive been learning on the go. Edited July 14, 2015 by earwaxking Link to comment Share on other sites More sharing options...
Tez2 Posted July 14, 2015 Share Posted July 14, 2015 check the player ped's model That is what I'm doing or so I thought since it is not working for me. Im checking the ID with local playerID = PLAYER.PLAYER_ID()local player = PLAYER.GET_PLAYER_PED(playerID)local playerPedID = PLAYER.PLAYER_PED_ID(player) Then in my if statment im checking that playerID is equal to the corresponding player value, Which I beleive is 1 for Micheal, 2 for Frankling, and 3 for Trevor. Forgive me if this is a very simple question. I am new to modding with Lua and there is very short supply on tutorials so ive been learning on the go. You mean the player ped ID for SP characters ? 0 is for micheal and 1 for franklin and 2 for trevor. Link to comment Share on other sites More sharing options...
InfamousSabre Posted July 14, 2015 Share Posted July 14, 2015 check the player ped's model That is what I'm doing or so I thought since it is not working for me. Im checking the ID with local playerID = PLAYER.PLAYER_ID()local player = PLAYER.GET_PLAYER_PED(playerID)local playerPedID = PLAYER.PLAYER_PED_ID(player) Then in my if statment im checking that playerID is equal to the corresponding player value, Which I beleive is 1 for Micheal, 2 for Frankling, and 3 for Trevor. Forgive me if this is a very simple question. I am new to modding with Lua and there is very short supply on tutorials so ive been learning on the go. That would be checking the ID, not the model. BOOL IS_PED_MODEL(Ped ped, Hash modelHash) // C9D55B1A358A5BF7 5F1DDFCB Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now