IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
  Reply to this topicStart new topicStart Poll

 C# Begginer | 1st Script |

 Criticism | Tips Required | TY
 
Mlnecrafter  
Posted: Sunday, Apr 8 2012, 15:15
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Apr 3, 2012

XXXXX



Hello everybody, so recently I just got hooked with c# when I found out that gta4 scripts can be written with it, so decided to give it a chance , also will serve as my training.

any criticism , tips / help are accepted. Thank you

So , my firs script is a random "Vehicle Spawner " .

I've uploaded code for better view:


Version 0.01.

Link to uploaded code V0.01

Version 0.02

updates:

After some work found out how to spawn cars in front of a character position or just by pointing camera to a desired direction.

replaced random randomness.


Link to uploaded code V0.02




oh and some quick explanation of script : on key U - spawns car | I - Spawns Bike | I Spawns Boat | O Spawns Plane |

if you can , tell me what do you think about it , or at which parts of code I should concentrate more or point me some tutorials or any important parts.

Highly Grateful


------------------- // ------------------------------ // ------------------------------ //

If you wanna try it out you can download file below \/ .

( Tested with 1.0.4.0 ).


Link to download random vehicle spawner V0.02

This post has been edited by Mlnecrafter on Monday, Apr 9 2012, 12:37
PM
  Top
 

 
nightwalker83  
Posted: Monday, Apr 9 2012, 01:02
Quote Post


Don't mind me
Group Icon
Group: Members
Joined: Oct 10, 2004

au.gif

XXXXX



Cool!
Users WebsitePMMSN
  Top
 

 
Mlnecrafter  
Posted: Monday, Apr 9 2012, 09:58
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Apr 3, 2012

XXXXX



QUOTE (nightwalker83 @ Monday, Apr 9 2012, 01:02)
Cool!


thanks , doing my best.

also updated to 0.02

Going to try making ngame menu to choose a vehicle from it.
PM
  Top
 

 
goin-god  
Posted: Monday, Apr 9 2012, 11:54
Quote Post


High Roller
Group Icon
Group: $outh $ide Hoodz
Joined: Mar 18, 2007

ar.gif

Member Award




The overall code looks nice. Nothing to worry about. But since this is GTA modding, if it works and dosn't take a sh*t load of time to compute, it's okay.
Users WebsitePMMSNPlayStation Network
  Top
 

 
Mlnecrafter  
Posted: Monday, Apr 9 2012, 12:40
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Apr 3, 2012

XXXXX



QUOTE (goin-god @ Monday, Apr 9 2012, 11:54)
The overall code looks nice. Nothing to worry about. But since this is GTA modding, if it works and dosn't take a sh*t load of time to compute, it's okay.

By S.Load of time to compute you mean, an answer for script action in game correct?

"I guess for now its like matters of ms.

but nobody has tested it yet. If you can try it out would be grateful.

And thank you.

p.s Added link to dl file.
PM
  Top
 

 
Frank.s  
Posted: Monday, Apr 9 2012, 12:52
Quote Post


 
Group Icon
Group: Members
Joined: Apr 15, 2008

en.gif

Member Award




Have you considered scripting in sco files instead of using hooked scripts?
I don't know c# or how to hook a c script so i can't judge your current version. Sco uses a syntax very similar to c so you'll probably get used to it easy.

Sco files are compiled using Scocl by Alexander Blade, if you do start sco scriting, have you considered making some scripts for IVSA?
PM
  Top
 

 

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG