Quantcast
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 Diamond Casino Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA 6

      1. St Andrews Cathedral
    3. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    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. DYOM
      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
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

Sign in to follow this  
maro_hannover

SCO Coding

Recommended Posts

maro_hannover

I've learned Scocl Compiler and script img. and Script small things in SCO. handling natives is easier there. i've learned half of c++ but SCO fails compiling my script and passes compiling Skopro's one. I've fixed all errors in the explorer and sometimes it compiles in .s format or does not compile(i am using commandline).

What is the best way to learn SCO Scripting. Stef Codes SCO too. there is no SCO Books. i bought a c# 2008 book but it is impossible for it to be SCO. SCO uses C++ Syntax and i am done with it. I want to learn SCO scripting like c#. Did'nt you see XMC, GTA V Phone by stef. he coded it in SCO.

Share this post


Link to post
Share on other sites
Noox

You learned half of C++ in less than 2 months? Jeez bro, you're the god of programming.

Since you learned C++, tell me how to prevent this memory leak

void memory_leak(){    int *x = new int[10];    //something more}

And, when you write parameters in functions using SCO, do you know what & means?

You don't give me an answer, I'll say go back and learn it first, there is a reason if in my class it took all of us 9 months to learn the basic things and some memory management later(about 3 months). Don't say you learned a programming language if you barely know C#.

 

Since you like it, I'm ready for insults, go ahead.

 

Not related, but screw pointers and all, it's time for Java this year.

 

EDIT: After this, I can laugh till tomorrow. Guess I won't go out with my friends tonight as they would think I'm already drunk

 

 

 

I've learned Scocl Compiler

So you learned the compiler, this question comes to my mind, do you know what the compiler is/does?

Edited by Noox
  • Like 1

Share this post


Link to post
Share on other sites
Rugz007

@ Noox and Mora : can you stop fighting and be friends :) please don't fight :(

Share this post


Link to post
Share on other sites
Noox

@ Noox and Mora : can you stop fighting and be friends :) please don't fight :(

Not fighting.

There is a difference between fighting and telling someone to go learn something.

Edited by Noox

Share this post


Link to post
Share on other sites
Jitnaught

@ Noox and Mora : can you stop fighting and be friends :) please don't fight :(

They aren't.
  • Like 1

Share this post


Link to post
Share on other sites
maro_hannover

@Noox

C++ have similitaries to c#
anyways here is an examples of what i've learned

those just any syntaxes

std::cout << "Noox is ......  "<< std::endl;std:cout << "My Friend;/*Result:Noox is ......My Friend*/std::cout << "Noox is ......"; std:cout << "My Friend"; *//*ResultNoox is...... my friend *//*std is the console namespacecout is writing in consoleendl is End Line
#include "natives.h" //to use invokation from header files
#include <iostream> //dunno how to explain
// GTA Declerations or Typestypedef unsigned int uint;typedef uint boolean;typedef uint bool; // not a mistaketypedef uint ScriptAny;typedef uint Weapon;typedef int Player;     typedef int FireId;typedef int Ped;typedef int Vehicle;typedef int Cam;typedef int CarGenerator;typedef int Group;typedef int Train;typedef int Pickup;typedef int Object;typedef int Interior;typedef int Blip;typedef int Texture;typedef int TextureDict;typedef int CoverPoint;typedef int DecisionMaker;typedef int Camera;typedef int TaskSequence;typedef int Char;typedef int Car;typedef int ColourIndex;typedef int Sphere;typedef struct _Vector3{	float x;	float y;	float z;} Vector3, *PVector3;typedef int ExplosionType;typedef int ShootMode;typedef int RelationshipGroup;typedef int QuadChar;
#define example //to define something//example// i like to code like san andreas by using those variables. $PLAYER_CHAR , $PLAYER_ACTOR#define $PLAYER_CHAR GetPlayerIndex()#define $PLAYER_ACTOR GetPlayerPed()// so instead of writing GetPlayerIndex() or GetPlayerPed() we can write $PLAYER_CHAR or $PLAYER_ACTOR
/*tip When Creating a ped or Car it says that vehicle is not compatible with *vehicle and when modifying the car like changing colors it says *vehicleis not compatible with vehicleso what to do is add & when declaringexample *///works with anything. not only carsVehicle Vincent;//thenCREATE_CAR(model, x, y, z, &Vincent, true);//then modify it normallySET_CAR_HEADING(Vincent, h);	CHANGE_CAR_COLOUR(Vincent,col1,col2);	SET_EXTRA_CAR_COLOURS(Vincent,scol1,scol2);	SET_CAR_ENGINE_ON(Vincent,0,0);	CREATE_CAR(3711685889,-952.93,900.80,13.08,&Vincent,1);	SET_CAR_HEADING(Vincent,268.60);	CHANGE_CAR_COLOUR(Vincent,51,51);	SET_CAR_ENGINE_ON(Vincent,0,0);	// Car Color	CHANGE_CAR_COLOUR(Vincent, col1, col2);	SET_EXTRA_CAR_COLOURS(Vincent, scol1, scol2);	// Clean Car	SET_VEHICLE_DIRT_LEVEL(Vincent, 0.0);	WASH_VEHICLE_TEXTURES(Vincent, 255);

Share this post


Link to post
Share on other sites
Noox

You learned like 0.2/4 of it.

 

I really hope you will make good mods sooner or later and that you will learn a language, but please, if you have to, do it correctly.

Edited by Noox

Share this post


Link to post
Share on other sites
leftas

Maro,

1.

std:cout << "My Friend;

I don't think this will compile, you didn't put 'quatation marks' at end ;) and you pust just one ':' not two(English is not native my language).

2. iostream is just "input/output"(google it)

3.C++ and C# just have few similarities in syntax, but they diffrent a lot.

 

Best regards,

Paul.

Share this post


Link to post
Share on other sites
maro_hannover

it means i can learn SCO Scripting. or impossible. i found a c# book and i bought it. it is 600 pages and it is in my native language and it is called Visual c# 2008. Anyways i reading a PDF c++ book. i know PDF Reading is not easy but it is only way. so you mean i should learn c++ for SCO or it does not matter?

Share this post


Link to post
Share on other sites
leftas

Learn C++ because SCO is C.

So if you learn C++ you will know C as well.

EDIT: just readed all posts.

 

Scocl Compiler

Wait wait wait... Compiler ? What the actual f*ck ? COMPILER ? You know how code is being corverted from human readable to machine code ? Wow dude, you just awesome. Even I learning asm(reverse engine) and c++(Memory managing) still not sure converting c++ to asm

 

Best regards,

Paul.

Edited by leftas

Share this post


Link to post
Share on other sites
maro_hannover

C++ is the same as C? Is'nt it?

Share this post


Link to post
Share on other sites
leftas

Similar, but not the same. In C there isn't boolean, loool. you need to use byte or declare it as 4 bytes(just in C)(but boolean is 1 by default).

As I never code in C, I can't say/see much difference between them, but there is wiki page for it Compatibility of C and C++

 

Best regards,

Paul.

Edited by leftas

Share this post


Link to post
Share on other sites
maro_hannover

Ok i will continue with book. although c# is awesome but Phone Checks are'nt available :'(

Share this post


Link to post
Share on other sites
Noox

Similar, but not the same. In C there isn't boolean, loool. you need to use byte or declare it as 4 bytes(just in C)(but boolean is 1 by default).

As I never code in C, I can't say/see much difference between them, but there is wiki page for it Compatibility of C and C++

 

Best regards,

Paul.

Well, the boolean type of C++ after all is just an integer, you can do this

bool flag = 1;flag++;cout<<flag<<endl;

it would print 2.

 

@Maro: No, they are not the same. C++ has OOP programming while C has not, C is mostly used for OS's.

Other than some different stuff like dynamic memory allocation (you have to use the malloc function to store something on the heap and in C++ you simply use the new keyword)

 

Maybe this is bullsh*t, but C is mostly used for operating systems. Might be wrong tho

  • Like 1

Share this post


Link to post
Share on other sites
leftas

Yea, Noox, you are completely right. just C is used for drivers/kernel sh*t in windows ;)

bool is from int subclass(I just more prefer byte(I think it also inthers from int) than int).

 

Best regards,

Paul.

  • Like 1

Share this post


Link to post
Share on other sites
Noox

Yea, Noox, you are completely right. just C is used for drivers/kernel sh*t in windows ;)

bool is from int subclass(I just more prefer byte(I think it also inthers from int) than int).

 

Best regards,

Paul.

yep, you can even use inline assembly which is cool for drivers since you can only access the registers with assembly

Edited by Noox

Share this post


Link to post
Share on other sites
NTAuthority

yep, you can even use inline assembly which is cool for drivers since you can only access the registers with assembly

NT is a portable (AND NO NOT PORTABLE AS IN 'YOU CAN CARRY IT') operating system, drivers should not use ANY inline assembly at all.

 

 

Similar, but not the same. In C there isn't boolean, loool. you need to use byte or declare it as 4 bytes(just in C)(but boolean is 1 by default).

see stdbool.h from C99-ish Edited by NTAuthority
  • Like 2

Share this post


Link to post
Share on other sites
leftas

Sorry for mistake. I was sure that c hasn't have booleans as ida needs to set 4 bytes to decompile correctly.

 

Best regards,

Paul.

Share this post


Link to post
Share on other sites
maro_hannover

Helped me alot. but something i wanted to understand about bytes. in my c# book there is full documentaion of bytes but i don't really understand what is the use of bytes. it means we will make kilobytes?Megabytes?GigaBytes?TeraBytes?Exabytes?Zetabytes?Youtabytes?

in my c# book

Byte X;Byte Y;
Edited by maro_hannover

Share this post


Link to post
Share on other sites
Jitnaught

 

Helped me alot. but something i wanted to understand about bytes. in my c# book there is full documentaion of bytes but i don't really understand what is the use of bytes. it means we will make kilobytes?Megabytes?GigaBytes?TeraBytes?Exabytes?Zetabytes?Youtabytes?

in my c# book

 

 

Byte X;

Byte Y;

 

Why is it so difficult for people to Google?

Share this post


Link to post
Share on other sites
maro_hannover

I told i knew bytes but i can't understand its use.

use it like number or what?

Share this post


Link to post
Share on other sites
Jitnaught

I told i knew bytes but i can't understand its use.

use it like number or what?

READ THE WEBPAGE!

 

a unit of storage capable of holding a single character.

 

Character:

In computer software, any symbol that requires one byte of storage. This includes all the ASCII and extended ASCII characters, including the space character. In character-based software, everything that appears on the screen, including graphics symbols, is considered to be a character. In graphics-based applications, the term character is generally reserved for letters, numbers, and punctuation.

Edited by LetsPlayOrDy

Share this post


Link to post
Share on other sites
leftas

But one byte can hold from 256(0-255).

 

Best regards,

Paul.

Share this post


Link to post
Share on other sites
Skorpro

@maro_hannover

 

Hi!

Question: Why are you trying to learn SCO reading a C# book?!? C# is like C++ (using classes => OOP!) and / or C++/CLI (.Net)... and SCO is like C! If you want to program s.t. in SCO you have to learn C basics first! And you don't need to buy books -> use google instead.

Most codes you can use in C++ ScriptHook don't work in SCO! So never try to use 'std::cout' (neither in C++ SH & nor in SCO) or 'std::sprintf' (in SCO). You MUST use (with a few exceptions) natives!

 

Example:

 

C++ SH

int ... = strcmp(char *, char *); // This works in C++ SH only!

SCO

int ... = COMPARE_STRING(char *, char *); // This works in SCO and C++ SH (CompareString)!

Note: In SCO there are some different declarations

C/C++ SH                   SCO-------------------------------------bool                       booleanunsigned int               uinteModel model               uint model....

Hint:

  1. Create a folder (eg. named NATIVES) and copy "natives.h" (from SCOCL) into it.
  2. Copy all decompiled SCOs into NATIVES-folder.
  3. Use tools like FileLocator Lite to find natives / code parts (right click on NATIVES-folder)
  4. Always use Notepad++ (Menu: Language -> C -> C) to open decompiled SCOs!
  5. Program your own SCO scripts in VC++ IDE (eg. Visual C++ 2010 Express)
  6. Compile your scripts using a BATCH (see "How to use SCOCL")
  7. If you find files with an '.s' extension in your output folder s.t. is wrong! Check your code again...

Good luck :)

 

PS: LOL -> My nick is S K O R P R O - NOT Skopro or Skorpo or ... ;)

  • Like 1

Share this post


Link to post
Share on other sites
Noox

@Skorpro: I'm sure he doesn't know what pointers are.

Share this post


Link to post
Share on other sites
Skorpro

@Skorpro: I'm sure he doesn't know what pointers are.

Maybe... so he has to learn the C basics :D

Share this post


Link to post
Share on other sites
maro_hannover

 

@Skorpro: I'm sure he doesn't know what pointers are.

Maybe... so he has to learn the C basics :D

 

Yes i know what is pointer. it is something to store Object variable(Object,Blip,Sphere,Car,Ped)

maybe....

And i though that c++ is c. i will keep learning

Share this post


Link to post
Share on other sites
maro_hannover

I actually learned SCO Scripting from SKOPRO;S Tutorial but he does not go further information

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • 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.