|
|
|
|
Would you like to get all the new info from
PSX-Scene in your email each day?
Want to learn more about the team keeping you up to date with the latest scene news?
Read about them now! Check out our Developer bios, too! | ||
|
|
i previously made my first steps into coding script and posted my 1st test codes in tutorial topic , but now i feel that my script examples should be posted here for they are more fittted for " developement , test , release " section .
i based everything i did on JDMAlex previoulsy established sources ... btw i would like to thanks him and everybody who shared infos and made efforts to make all this possible.
heres what i done so far :
i tested them myself :Code:// add in GeneralInput.c /**************************************************** Random Player Component Variations (DPAD_DOWN + TRIANGLE) *****************************************************/ void InputPlayerComponents(void) { if( IsKeyPressed(DPAD_DOWN,TRIANGLE) ) { SET_CHAR_RANDOM_COMPONENT_VARIATION(GetPlayerPed()); Print("Player Random Component variation"); } } /**************************************************** toggle Everyone Ignore Player (DPAD_DOWN + SQUARE) *****************************************************/ boolean EveryIgnoreInt = 0; void InputEveryoneIgnore(void) { if( IsKeyPressed(DPAD_DOWN,SQUARE) ) { if(EveryIgnoreInt == 0) { EveryIgnoreInt = 1; SET_EVERYONE_IGNORE_PLAYER(GetPlayerIndex(), TRUE); Print("Everyone Ignore Player ON"); } else if(EveryIgnoreInt == 1) { EveryIgnoreInt = 0; SET_EVERYONE_IGNORE_PLAYER(GetPlayerIndex(), FALSE); Print("Everyone Ignore Player OFF"); } } } /**************************************************** toggle Player Invisible To AI (DPAD_DOWN + X) *****************************************************/ boolean InvisibleToAiInt = 0; void InputInvisibleToAI(void) { if( IsKeyPressed(DPAD_DOWN,X) ) { if(InvisibleToAiInt == 0) { InvisibleToAiInt = 1; SET_PLAYER_INVISIBLE_TO_AI(TRUE); Print("Invisible To AI ON"); } else if(InvisibleToAiInt == 1) { InvisibleToAiInt = 0; SET_PLAYER_INVISIBLE_TO_AI(FALSE); Print("Invisible To AI OFF"); } } } /**************************************************** toggle Give / Remove Helmet To Player (DPAD_DOWN + CIRCLE) *****************************************************/ boolean HelmetInt = 0; void InputGiveHelmetToPlayer(void) { if( IsKeyPressed(DPAD_DOWN,CIRCLE) ) { if(HelmetInt == 0) { HelmetInt = 1; //ENABLE_PED_HELMET(GetPlayerPed(), TRUE); GIVE_PED_HELMET_WITH_OPTS(GetPlayerPed(), TRUE); Print("Player Helmet ON"); } else if(HelmetInt == 1) { HelmetInt = 0; REMOVE_PLAYER_HELMET(GetPlayerIndex(), TRUE); Print("Player Helmet OFF"); } } } /**************************************************** toggle Player Wont Fly Through Windscreen (DPAD_DOWN + L1) *****************************************************/ boolean WindscreenInt = 0; void InputWindscreen(void) { if( IsKeyPressed(DPAD_DOWN,L1) ) { if(WindscreenInt == 0) { WindscreenInt = 1; SET_CHAR_WILL_FLY_THROUGH_WINDSCREEN(GetPlayerPed(), FALSE); Print("Player Wont Fly Through Windscreen ON"); } else if(WindscreenInt == 1) { WindscreenInt = 0; SET_CHAR_WILL_FLY_THROUGH_WINDSCREEN(GetPlayerPed(), TRUE); Print("Player Wont Fly Through Windscreen OFF"); } } } /**************************************************** toggle Player is Everything proof (DPAD_DOWN + L2) *****************************************************/ boolean NikoProofsInt = 0; void InputPlayerProofs(void) { if( IsKeyPressed(DPAD_DOWN,L2) ) { if(NikoProofsInt == 0) { NikoProofsInt = 1; SET_CHAR_PROOFS(GetPlayerPed(), TRUE, TRUE, TRUE, TRUE, TRUE); Print("Player Is Everything Proof ON"); } else if(NikoProofsInt == 1) { NikoProofsInt = 0; SET_CHAR_PROOFS(GetPlayerPed(), FALSE, FALSE, FALSE, FALSE, FALSE); Print("Player Is Everything Proof OFF"); } } } /**************************************************** toggle more vehicles spawns (DPAD_DOWN + R1) *****************************************************/ boolean CdensityInt = 0; void InputCdensity(void) { if( IsKeyPressed(DPAD_DOWN,R1) ) { if(CdensityInt == 0) { CdensityInt = 1; SET_CAR_DENSITY_MULTIPLIER(2.0f); Print("More Vehicles Spawns ON"); } else if(CdensityInt == 1) { CdensityInt = 0; SET_CAR_DENSITY_MULTIPLIER(1.0f); Print("More Vehicles Spawns OFF"); } } } /**************************************************** toggle more Peds spawns (DPAD_DOWN + R2) *****************************************************/ boolean PdensityInt = 0; void InputPdensity(void) { if( IsKeyPressed(DPAD_DOWN,R2) ) { if(PdensityInt == 0) { PdensityInt = 1; SET_PED_DENSITY_MULTIPLIER(2.0f); Print("More Peds Spawns ON"); } else if(PdensityInt == 1) { PdensityInt = 0; SET_PED_DENSITY_MULTIPLIER(1.0f); Print("More Peds Spawns OFF"); } } } /**************************************************** toggle Player Cant Fall Off Bike (DPAD_DOWN + STICK_L) *****************************************************/ boolean BikeFallInt = 0; void InputBikeFall(void) { if( IsKeyPressed(DPAD_DOWN,STICK_L) ) { if(BikeFallInt == 0) { BikeFallInt = 1; SET_CHAR_CAN_BE_KNOCKED_OFF_BIKE(GetPlayerPed(), TRUE); Print("Player Cant Fall Off Bikes ON"); } else if(BikeFallInt == 1) { BikeFallInt = 0; SET_CHAR_CAN_BE_KNOCKED_OFF_BIKE(GetPlayerPed(), FALSE); Print("Player Cant Fall Off Bikes OFF"); } } } // add each input below to already created " void GeneralInput(void) " section in JDMalex Source void GeneralInput(void) { InputPlayerComponents(); InputEveryoneIgnore(); InputInvisibleToAI(); InputGiveHelmetToPlayer(); InputWindscreen(); InputPlayerProofs(); InputCdensity(); InputPdensity(); InputBikeFall(); }
- InputPlayerComponents
will change player components ( cloths , textures ) works well ! it even works with models from JDMAlex " Change Player model " mod.
- InputEveryoneIgnore (toogle )
everyone will ignore player , even cops .
- InputInvisibleToAI ( toogle )
needs more testing !! dosnt freeze game , but im not quite sure what AI is affected by this command .
- InputGiveHelmetToPlayer ( toogle )
will give and remove player helmet , work fine , but id like to add put/remove animations and add more helmet models ( thoses from multiplayer )
- InputWindscreen ( toogle )
works well , player wont fly through vehicle windscreen when you hit something solid at high speed.
- InputPlayerProofs( toogle )
works fine , however its effect kinda similar to " invincible " mod.
proofs are : bullet-proof , fire-proof , explosion-proof , collision-proof , melee-proof
- InputCdensity ( toogle )
increase vehicle density , effect seems to take a moment to kick in , but i did get the feeling there was more cars around .
edit : re-tested it , works .. since its a multiplier , effect will vary depending in what area you are in since it double already set ( default ) density
- InputPdensity ( toogle )
increase ped density , needs more testing , effect seems to take a moment to kick in , but i did get the feeling there was more peds around .
edit : re-tested it , works .. since its a multiplier , effect will vary depending in what area you are in since it double already set ( default ) density .
- InputBikeFall ( toogle )
works well ! player wont fall off bikes.
Note : i wont upload a compiled modscript file including my codes , but i will share my script examples gladly , anyone who can compile a script can use them if they want to .
EDIT : fixed - InputBikeFall ( toogle ) ... seems native does opposite of what its named , works anyways.
Last edited by HuN; 03-31-2012 at 01:59 PM.
| « Previous Thread | Next Thread » |
| Tags for this Thread |