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 Tree213Likes

Thread: General Help
  

Page 71 of 97 FirstFirst ... 21 61 69 70 71 72 73 81 ... LastLast
Results 701 to 710 of 964
  1. #701  
    creighton is offline OhManMyBad
    Join Date
    Aug 2012
    Posts
    206
    Downloads
    2
    Uploads
    0
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    151
    Likes Received
    172
    Quote Originally Posted by ribonucleic View Post
    i don't understand are you saying 2d arrays don't work? just a yes or no will suffice
    No they do not work. See this: http://psx-scene.com/forums/f276/%5B...cripts-102230/

    Quote Originally Posted by ribonucleic View Post
    PHP Code:
    char *strings[5]; //did i define the correct number of items? should it be 4?
    string[0]="hello";
    string[1]="ohell";
    string[2]="lohel"//hello rotates like on a side scrolling electronic notice board
    string[3]="llohe";
    string[4]="elloh"
    I was also answering your question from the code you posted. Yes, you defined the correct number of items for that array.
    Reply With Quote  

  2. #702  
    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
    Quote Originally Posted by ribonucleic View Post
    quick question do 2d arrays work in gta scripts?

    PHP Code:
    char *strings[5]; //did i define the correct number of items? should it be 4?
    string[0]="hello";
    string[1]="ohell";
    string[2]="lohel"//hello rotates like on a side scrolling electronic notice board
    string[3]="llohe";
    string[4]="elloh";

    char *newstring="00000";

    newstring[0]=string[0][0];
    newstring[1]=string[4][0];
    newstring[2]=string[3][0];
    newstring[3]=string[2][0];
    newstring[4]=string[1][0];

    //would newstring now say hello? 
    individual string characters can be accessed by treating a string as an array in c


    btw the reason for the example will become clear soon
    I always thought you couldnt declare strings as an array of chars e.g.
    Code:
    char string[5];
    string[0] = 'h';
    string[1] = 'e';
    string[2] = 'l';
    string[3] = 'l';
    string[4] = 'o';
    
    COMPARE_STRING("hello", string);//which i think returns false
    Reply With Quote  

  3. #703  
    ribonucleic's Avatar
    ribonucleic is online now Moderator & Developer
    Join Date
    Mar 2012
    Posts
    639
    Downloads
    4
    Uploads
    0
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    121
    Likes Received
    276
    Quote Originally Posted by zorg93 View Post
    I always thought you couldnt declare strings as an array of chars e.g.
    Code:
    char string[5];
    string[0] = 'h';
    string[1] = 'e';
    string[2] = 'l';
    string[3] = 'l';
    string[4] = 'o';
    
    COMPARE_STRING("hello", string);//which i think returns false
    what i did wasn't declaring it was referencing, arrays indexes are basically pointers
    PHP Code:
    char *string="hello";

    char *char1arrayindex=string[0]; //h from hello
    char *char1pointer=*(string+0); //h from hello (again)

    char *char2arrayindex=string[1]; //e from hello
    char *char2pointer=*(string+1); //e from hello (again)

    char *char5arrayindex=string[4]; //o from hello
    char *char5pointer=*(string+4); //o from hello (again) 
    correct me if i'm wrong, i'm sure @Raeralus would know
    Reply With Quote  

  4. #704  
    xX7MoD's Avatar
    xX7MoD is offline Member
    Join Date
    Dec 2012
    Location
    dubai
    Posts
    10
    Downloads
    2
    Uploads
    0
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    2
    hi
    Last edited by ribonucleic; 02-13-2013 at 09:15 AM.
    Reply With Quote  

  5. #705  
    ribonucleic's Avatar
    ribonucleic is online now Moderator & Developer
    Join Date
    Mar 2012
    Posts
    639
    Downloads
    4
    Uploads
    0
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    121
    Likes Received
    276
    Quote Originally Posted by xX7MoD View Post
    hi
    do you have a question relating to GTA IV modding?
    Reply With Quote  

  6. #706  
    InTheSevens's Avatar
    InTheSevens is offline Member
    Join Date
    Oct 2012
    Posts
    127
    Downloads
    2
    Uploads
    0
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    52
    Likes Received
    65
    Quote Originally Posted by ribonucleic View Post
    do you have a question relating to GTA IV modding?
    Pretty sure he's just over here lurking from se7en.
    Reply With Quote  

  7. #707  
    ribonucleic's Avatar
    ribonucleic is online now Moderator & Developer
    Join Date
    Mar 2012
    Posts
    639
    Downloads
    4
    Uploads
    0
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    121
    Likes Received
    276
    Quote Originally Posted by GMFB View Post
    Pretty sure he's just over here lurking from se7en.
    we'll see if he finally answers, if not then his post is going to disappear
    Reply With Quote  

  8. #708  
    InTheSevens's Avatar
    InTheSevens is offline Member
    Join Date
    Oct 2012
    Posts
    127
    Downloads
    2
    Uploads
    0
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    52
    Likes Received
    65
    Quote Originally Posted by ribonucleic View Post
    we'll see if he finally answers, if not then his post is going to disappear
    How about you go take a look at the 7 posts he made in the "GTA Online Mods (help)" thread. I'm sure there will be no hesitation in deleting those. He's just trolling, if you ask me. ;-)
    Reply With Quote  

  9. #709  
    ribonucleic's Avatar
    ribonucleic is online now Moderator & Developer
    Join Date
    Mar 2012
    Posts
    639
    Downloads
    4
    Uploads
    0
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    121
    Likes Received
    276
    @xX7MoD you're not welcome in my books, keep on with the spam and you'll find yourself being marched out of these forums

    @GMFB thanks for the heads up on those posts
    Reply With Quote  

  10. #710  
    EvilB's Avatar
    EvilB is offline Bringin' that funky flava
    Join Date
    Jan 2011
    Posts
    405
    Downloads
    16
    Uploads
    0
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    68
    Likes Received
    456
    @ribonucleic
    I dont know anything on this so correct me if im wrong but wouldnt something like this work for pointing your strings or chars.

    PHP Code:
    char *strarray[2][5] = { { "hello""ohell""lohel""llohe""elloh" }, { "1""2""3""4""5" } };

    strarray[1][1]; // hello
    strarray[1][2]; // ohell
    strarray[1][3]; // lohel
    strarray[1][4]; // llohe
    strarray[1][5]; // elloh
    strarray[2][1]; // 1
    strarray[2][2]; // 2
    strarray[2][3]; // 3
    strarray[2][4]; // 4
    strarray[2][5]; // 5 
    Reply With Quote  

Page 71 of 97 FirstFirst ... 21 61 69 70 71 72 73 81 ... LastLast
Tags for this Thread

View Tag Cloud

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •