Quantcast

Jump to content

» «
Photo

C# Begginer | 1st Script |

5 replies to this topic
Mlnecrafter
  • Mlnecrafter

    Player Hater

  • Members
  • Joined: 03 Apr 2012

#1

Posted 08 April 2012 - 03:15 PM Edited by Mlnecrafter, 09 April 2012 - 12:37 PM.

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

nightwalker83
  • nightwalker83

    Don't mind me

  • Members
  • Joined: 10 Oct 2004

#2

Posted 09 April 2012 - 01:02 AM

Cool!

Mlnecrafter
  • Mlnecrafter

    Player Hater

  • Members
  • Joined: 03 Apr 2012

#3

Posted 09 April 2012 - 09:58 AM

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.

coin-god
  • coin-god

    High Roller

  • $outh $ide Hoodz
  • Joined: 18 Mar 2007

#4

Posted 09 April 2012 - 11:54 AM

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.

Mlnecrafter
  • Mlnecrafter

    Player Hater

  • Members
  • Joined: 03 Apr 2012

#5

Posted 09 April 2012 - 12:40 PM

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.

Frank.s
  • Frank.s

    PingPang

  • Feroci Racing
  • Joined: 15 Apr 2008
  • None

#6

Posted 09 April 2012 - 12:52 PM

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?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users