Forum: Grand Theft Auto Series Modding - Our GTA Modding Team is the best around. Tutorials & Topics related to modding your GTA games, trophies, and save files! Discuss GTA game modding with the knowledgeable members of PSX-Scene and the Official GTA IV Mod Team.


The above video goes away if you are a member and logged in, so log in now!




 
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!

 


User Tag List

Like Tree3Likes

Thread: Need your opinion!
  

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
  1. #1 Need your opinion! 
    keredor's Avatar
    keredor is online now Developer
    Join Date
    Mar 2012
    Posts
    180
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    136
    Likes Received
    123
    Heys guys, bit of a funny one here. im just starting out on making a script. I have it at a stage where it should be working in-game, but its not. infact nothing happens at all. If anyone has any ideas i would love to hear them.
    Code:
     #include <natives.h>
    #include <common.h>
    #include <strings.h>
    #include <types.h>
    #include <consts.h>
    
    #include "settings.c"
    
    
    float x1, y1, z1;
    Ped carped;
    Vehicle pedcar, mycar;
    int carmake;
    bool Exist=0;
    Group mygroup;
    
    
    void findme(void)
        {
        if (IS_CHAR_IN_ANY_CAR(GetPlayerPed()))
        {
        GET_CAR_CHAR_IS_USING(GetPlayerPed(), &mycar);
        GET_CAR_MODEL(mycar, &carmake);
        GET_CHAR_COORDINATES(GetPlayerPed(), &x1, &y1, &z1);
        }
        }
    
    void CreateGroup(void)
    {
    	if(Exist==0)
    	{
    	GET_PLAYER_GROUP(GetPlayerIndex(), &mygroup);
    	if(!DOES_GROUP_EXIST(mygroup))
    	{
    		CREATE_GROUP(0, mygroup, true);
    		SET_GROUP_LEADER(mygroup, GetPlayerPed());
    		SET_GROUP_SEPARATION_RANGE(mygroup, 9999.9);
            SET_PLAYER_GROUP_TO_FOLLOW_ALWAYS(GetPlayerPed());
            SET_GROUP_FOLLOW_STATUS(mygroup,1);
            SET_GROUP_FORMATION(mygroup,3);
            SET_GROUP_FORMATION_SPACING(mygroup, 5);
    		Exist=1;
    	}
    	}
    }
    
    void carprefs(void)
    {
        LOCK_CAR_DOORS(carmake,4);
        SET_CAR_CAN_BE_DAMAGED(carmake, 0);
        SET_CAR_CAN_BE_VISIBLY_DAMAGED(carmake, 0);
        SET_CAN_BURST_CAR_TYRES(carmake, 0);
        SET_CAR_ALWAYS_CREATE_SKIDS(carmake, 1);
    }
    
    void pedprefs(void)
    {
        SET_GROUP_MEMBER(mygroup, carped);
        SET_GROUP_CHAR_DUCKS_WHEN_AIMED_AT(carped, false);
    	SET_CHAR_NEVER_LEAVES_GROUP(carped, true);
    	SET_CHAR_ACCURACY(carped, 100);
    	SET_CHAR_CAN_BE_SHOT_IN_VEHICLE(carped, false);
    	SET_CHAR_WILL_DO_DRIVEBYS(carped, true);
    	SET_CHAR_WILL_MOVE_WHEN_INJURED(carped, true);
    	SET_CHAR_WILL_USE_COVER(carped, false);
        SET_CHAR_BULLETPROOF_VEST(carped, true);
    	SET_CHAR_PROVIDE_COVERING_FIRE(carped, true);
    	SET_CHAR_WILL_USE_CARS_IN_COMBAT(carped, true);
    	SET_PED_DONT_DO_EVASIVE_DIVES(carped, true);
    	SET_CURRENT_CHAR_WEAPON(carped, WEAPON_MP5, true);
    }
    
    
    void createpeds(void)
        {
        findme();
        CreateGroup();
            GET_CHAR_COORDINATES(GetPlayerPed(), &x1, &y1, &z1);
            REQUEST_MODEL(carmake);
            while (!HAS_MODEL_LOADED(carmake)) WAIT(0);
            CREATE_CAR(carmake, x1+3.0f, y1, z1, &carmake, 1);
               REQUEST_MODEL(MODEL_M_M_FATCOP_01);
               while (!HAS_MODEL_LOADED(MODEL_M_M_FATCOP_01)) WAIT(0);
               CREATE_CHAR_INSIDE_CAR(carmake, 16, MODEL_M_M_FATCOP_01, &carped);
            carprefs();
            pedprefs();
        }
    
    void pedspawner(void)
     {
        if(IS_BUTTON_JUST_PRESSED(0, DPAD_RIGHT))
         {
             createpeds();
         }
    else if((IS_BUTTON_PRESSED(0, R1))  &&  (DOES_CHAR_EXIST,carped))
         {
             FIRE_PED_WEAPON(carped,0, 0, 0);
         }
     }
    
    
    void main(void)
      {
        THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
        pedspawner();
        WAIT(0);
      }
    Reply With Quote  

  2. #2  
    HuN's Avatar
    HuN
    HuN is online now Moderator
    Join Date
    Feb 2012
    Posts
    463
    Downloads
    2
    Uploads
    0
    Mentioned
    22 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    437
    Likes Received
    402
    Quote Originally Posted by keredor View Post
    Heys guys, bit of a funny one here. im just starting out on making a script. I have it at a stage where it should be working in-game, but its not. infact nothing happens at all. If anyone has any ideas i would love to hear them.
    Code:
     #include <natives.h>
    #include <common.h>
    #include <strings.h>
    #include <types.h>
    #include <consts.h>
    
    #include "settings.c"
    
    
    float x1, y1, z1;
    Ped carped;
    Vehicle pedcar, mycar;
    int carmake;
    bool Exist=0;
    Group mygroup;
    
    
    void findme(void)
        {
        if (IS_CHAR_IN_ANY_CAR(GetPlayerPed()))
        {
        GET_CAR_CHAR_IS_USING(GetPlayerPed(), &mycar);
        GET_CAR_MODEL(mycar, &carmake);
        GET_CHAR_COORDINATES(GetPlayerPed(), &x1, &y1, &z1);
        }
        }
    
    void CreateGroup(void)
    {
    	if(Exist==0)
    	{
    	GET_PLAYER_GROUP(GetPlayerIndex(), &mygroup);
    	if(!DOES_GROUP_EXIST(mygroup))
    	{
    		CREATE_GROUP(0, mygroup, true);
    		SET_GROUP_LEADER(mygroup, GetPlayerPed());
    		SET_GROUP_SEPARATION_RANGE(mygroup, 9999.9);
            SET_PLAYER_GROUP_TO_FOLLOW_ALWAYS(GetPlayerPed());
            SET_GROUP_FOLLOW_STATUS(mygroup,1);
            SET_GROUP_FORMATION(mygroup,3);
            SET_GROUP_FORMATION_SPACING(mygroup, 5);
    		Exist=1;
    	}
    	}
    }
    
    void carprefs(void)
    {
        LOCK_CAR_DOORS(carmake,4);
        SET_CAR_CAN_BE_DAMAGED(carmake, 0);
        SET_CAR_CAN_BE_VISIBLY_DAMAGED(carmake, 0);
        SET_CAN_BURST_CAR_TYRES(carmake, 0);
        SET_CAR_ALWAYS_CREATE_SKIDS(carmake, 1);
    }
    
    void pedprefs(void)
    {
        SET_GROUP_MEMBER(mygroup, carped);
        SET_GROUP_CHAR_DUCKS_WHEN_AIMED_AT(carped, false);
    	SET_CHAR_NEVER_LEAVES_GROUP(carped, true);
    	SET_CHAR_ACCURACY(carped, 100);
    	SET_CHAR_CAN_BE_SHOT_IN_VEHICLE(carped, false);
    	SET_CHAR_WILL_DO_DRIVEBYS(carped, true);
    	SET_CHAR_WILL_MOVE_WHEN_INJURED(carped, true);
    	SET_CHAR_WILL_USE_COVER(carped, false);
        SET_CHAR_BULLETPROOF_VEST(carped, true);
    	SET_CHAR_PROVIDE_COVERING_FIRE(carped, true);
    	SET_CHAR_WILL_USE_CARS_IN_COMBAT(carped, true);
    	SET_PED_DONT_DO_EVASIVE_DIVES(carped, true);
    	SET_CURRENT_CHAR_WEAPON(carped, WEAPON_MP5, true);
    }
    
    
    void createpeds(void)
        {
        findme();
        CreateGroup();
            GET_CHAR_COORDINATES(GetPlayerPed(), &x1, &y1, &z1);
            REQUEST_MODEL(carmake);
            while (!HAS_MODEL_LOADED(carmake)) WAIT(0);
            CREATE_CAR(carmake, x1+3.0f, y1, z1, &carmake, 1);
               REQUEST_MODEL(MODEL_M_M_FATCOP_01);
               while (!HAS_MODEL_LOADED(MODEL_M_M_FATCOP_01)) WAIT(0);
               CREATE_CHAR_INSIDE_CAR(carmake, 16, MODEL_M_M_FATCOP_01, &carped);
            carprefs();
            pedprefs();
        }
    
    void pedspawner(void)
     {
        if(IS_BUTTON_JUST_PRESSED(0, DPAD_RIGHT))
         {
             createpeds();
         }
    else if((IS_BUTTON_PRESSED(0, R1))  &&  (DOES_CHAR_EXIST,carped))
         {
             FIRE_PED_WEAPON(carped,0, 0, 0);
         }
     }
    
    
    void main(void)
      {
        THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
        pedspawner();
        WAIT(0);
      }

    try this in " main" :

    Code:
     
    void main(void)
    {	
    	THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
    	while (TRUE)
    	{
    		WAIT(0);
    		 pedspawner();
    	}
    }
    keredor likes this.
    Reply With Quote  

  3. #3  
    keredor's Avatar
    keredor is online now Developer
    Join Date
    Mar 2012
    Posts
    180
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    136
    Likes Received
    123
    Quote Originally Posted by HuN View Post
    try this in " main" :

    Code:
     
    void main(void)
    {	
    	THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
    	while (TRUE)
    	{
    		WAIT(0);
    		 pedspawner();
    	}
    }
    Thank's HuN. Ill test it out later tonight and let you know if it worked out.
    Reply With Quote  

  4. #4  
    HuN's Avatar
    HuN
    HuN is online now Moderator
    Join Date
    Feb 2012
    Posts
    463
    Downloads
    2
    Uploads
    0
    Mentioned
    22 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    437
    Likes Received
    402
    good luck !

    btw , in " main " example here ... anything above " while ( true ) " is read once by engine , everything under " wait(0); " is read continiously (loop)
    keredor likes this.
    Reply With Quote  

  5. #5  
    keredor's Avatar
    keredor is online now Developer
    Join Date
    Mar 2012
    Posts
    180
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    136
    Likes Received
    123
    Quote Originally Posted by HuN View Post
    good luck !

    btw , in " main " example here ... anything above " while ( true ) " is read once by engine , everything under " wait(0); " is read continiously (loop)
    Ok, that's cool. It then makes sense as to why nothing was happening in game.
    Reply With Quote  

  6. #6  
    zorg93's Avatar
    zorg93 is online now Developer
    Join Date
    Jun 2012
    Posts
    255
    Downloads
    0
    Uploads
    0
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    50
    Likes Received
    142
    lol, missed while loop was the error, hahaha. your getting abit slack keredor :P
    Reply With Quote  

  7. #7  
    keredor's Avatar
    keredor is online now Developer
    Join Date
    Mar 2012
    Posts
    180
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    136
    Likes Received
    123
    Quote Originally Posted by zorg93 View Post
    lol, missed while loop was the error, hahaha. your getting abit slack keredor :P
    LMAO. a very low standard from me. because i worked alot with alex's menu lately, have not been creating a main function. lesson learned the hard way!
    Reply With Quote  

  8. #8  
    HuN's Avatar
    HuN
    HuN is online now Moderator
    Join Date
    Feb 2012
    Posts
    463
    Downloads
    2
    Uploads
    0
    Mentioned
    22 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    437
    Likes Received
    402
    Quote Originally Posted by keredor View Post
    LMAO. a very low standard from me. because i worked alot with alex's menu lately, have not been creating a main function. lesson learned the hard way!
    simple errors that are not detected by compiler , can sometimes be the most hard to find ... for they can be too obvious for your brain to even consider them .

    btw , when i replied , i didnt remembered you released a menu and that you knew coding ! sorry if my reply offended you in any way ( just in case )
    Reply With Quote  

  9. #9  
    keredor's Avatar
    keredor is online now Developer
    Join Date
    Mar 2012
    Posts
    180
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    136
    Likes Received
    123
    Quote Originally Posted by HuN View Post
    simple errors that are not detected by compiler , can sometimes be the most hard to find ... for they can be too obvious for your brain to even consider them .

    btw , when i replied , i didnt remembered you released a menu and that you knew coding ! sorry if my reply offended you in any way ( just in case )
    No man you most certainly did not offend me!It was just the exact piece of advice i was after.I knew I was missing something and just couldn't put my finger on it.So thank you for helping out. Also I know there is not much point in saying this, but it worked lastnight!
    Reply With Quote  

  10. #10  
    HuN's Avatar
    HuN
    HuN is online now Moderator
    Join Date
    Feb 2012
    Posts
    463
    Downloads
    2
    Uploads
    0
    Mentioned
    22 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    437
    Likes Received
    402
    Quote Originally Posted by keredor View Post
    No man you most certainly did not offend me!It was just the exact piece of advice i was after.I knew I was missing something and just couldn't put my finger on it.So thank you for helping out. Also I know there is not much point in saying this, but it worked lastnight!
    i was playing safe here ... english aint my 1st language , so i rather say im sorry when im a little confused .

    im glad i could help
    Reply With Quote  

Page 1 of 2 1 2 LastLast
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •