SA-MP Forums

Go Back   SA-MP Forums > Search Forums

Showing results 1 to 21 of 21
Search took 0.00 seconds.
Search: Posts Made By: MP2
Forum: Discussion 06/03/2014, 05:20 AM
Replies: 148
Views: 26,197
Posted By MP2
Re: Gamemode Script Layout

Wouldn't the simplest way be to declare variables first, hook next, then the main modules next? What would be the problem with that?
Forum: Discussion 06/03/2014, 04:30 AM
Replies: 148
Views: 26,197
Posted By MP2
Re: Gamemode Script Layout

So you're saying include every module inside every other module? That's going to be very tricky with hundreds of modules.. Every module I add I'm going to have to add it to 99 other files...
Forum: Discussion 06/03/2014, 04:11 AM
Replies: 148
Views: 26,197
Posted By MP2
Re: Gamemode Script Layout

I don't think you understand the problem. I need to ensure that before a native function is used by a module, it's hooked, so hooked functions have to come first, before any modules - not inside the...
Forum: Discussion 06/03/2014, 03:46 AM
Replies: 148
Views: 26,197
Posted By MP2
Re: Gamemode Script Layout

By 'file' (first one) you mean the main gamemode file? So basically..

main.pwn

#include <a_samp>

#include <samphooks>

#include <module1>
#include <module2>
Forum: Discussion 06/03/2014, 02:46 AM
Replies: 148
Views: 26,197
Posted By MP2
Re: Respuesta: Re: Gamemode Script Layout

No, you can include any file type. I personally use .inc for libraries and .pwn for scripts (modules). I use other files types too (e.g. .def for defines, .map for objects/maps etc.).

Anyway, I...
Forum: Discussion 06/03/2014, 02:24 AM
Replies: 148
Views: 26,197
Posted By MP2
Re: Gamemode Script Layout

Yeah, that's what I meant.
Forum: Discussion 06/03/2014, 02:15 AM
Replies: 148
Views: 26,197
Posted By MP2
Re: Gamemode Script Layout

I just had a thought about vehicle loops, specifically only looping through vehicles which are near-by for a player. Couldn't you simply have a per-player iteration for 'nearby vehicles' based on...
Forum: Discussion 05/03/2014, 02:52 AM
Replies: 148
Views: 26,197
Posted By MP2
Re: Respuesta: Gamemode Script Layout

But surely calling a local function 2000 times is going to be slower than a 2000 loop..
Forum: Discussion 04/03/2014, 05:21 PM
Replies: 148
Views: 26,197
Posted By MP2
Re: Gamemode Script Layout

ALS works with any callback. It's y_hooks that doesn't (in < 3.0).
Forum: Discussion 24/01/2014, 03:01 PM
Replies: 148
Views: 26,197
Posted By MP2
Re: AW: Re: Gamemode Script Layout

Hmm, I'm sure I updated it only a couple of months ago. Guess it was added in that time.. But yeah, found it now, thanks.

EDIT: Seems it was added on 26 March, 2012.. Guess I haven't updated in a...
Forum: Discussion 24/01/2014, 02:07 PM
Replies: 148
Views: 26,197
Posted By MP2
Re: Gamemode Script Layout

I can't seem to find the 'document map' D:

This is my toolbar:
http://puu.sh/6woHj.png

Can't find it in any of the dropdowns either (File, Edit, View etc.).
Forum: Discussion 24/01/2014, 01:27 PM
Replies: 148
Views: 26,197
Posted By MP2
Re: Gamemode Script Layout

I think 1000 should be enough :p Thanks.
Forum: Discussion 24/01/2014, 12:36 PM
Replies: 148
Views: 26,197
Posted By MP2
Re: Gamemode Script Layout

I'm using YSI 4, and I'm actually the one who asked you to increase the limit, because of this topic.

So yeah, eventually when my script is massive, surely I'll have more hooks than y_unique can...
Forum: Discussion 24/01/2014, 12:09 PM
Replies: 148
Views: 26,197
Posted By MP2
Re: Scripting in files - too much?

I knew the topic existed - it's mine and I even linked to it in the new topic. I just never thought about posting a follow-up in THAT topic. Oops :P

Anyway, thanks for your reply, it clears a lot...
Forum: Discussion 23/01/2014, 10:56 PM
Replies: 148
Views: 26,197
Posted By MP2
Scripting in files - too much?

I've always scripted my gamemodes (the VERY few I have made) in one single .pwn file, but about a year and a half ago realised how bad code practise that was, and started using files...
Forum: Discussion 30/04/2013, 08:57 AM
Replies: 148
Views: 26,197
Posted By MP2
Forum: Discussion 30/04/2013, 08:23 AM
Replies: 148
Views: 26,197
Posted By MP2
Re: Gamemode Script Layout

I'm using a proper file system now, but it's fucking annoying that I can't Ctrl+F for stuff, and Windows 7 is fabulous and doesn't search my file contents (even though in search settings it's set...
Forum: Discussion 08/07/2012, 02:53 AM
Replies: 148
Views: 26,197
Posted By MP2
Re: Gamemode Script Layout

Yeah I know about that.
Forum: Discussion 08/07/2012, 01:37 AM
Replies: 148
Views: 26,197
Posted By MP2
Re: Gamemode Script Layout

Well I've decided to do a bit of both. I'm still going to have a lot of stuff in the gamemode but some 'systems' will be in files such as the ammunation script. I don't like the idea of having a...
Forum: Discussion 05/07/2012, 03:13 AM
Replies: 148
Views: 26,197
Posted By MP2
Re: Gamemode Script Layout

The general reason I and others put arrays and enums etc. above callbacks is because (obviously) the callbacks can't use them if they're declared after them. Most of them get used in OnGameModeInit...
Forum: Discussion 04/07/2012, 08:36 PM
Replies: 148
Views: 26,197
Posted By MP2
Gamemode Script Layout

Hei.

I've recently started development of a new gamemode/server and while originally the layout was okay, as it's building up more and more code it seems to be working less.

I have this issue...
Showing results 1 to 21 of 21

 

All times are GMT. The time now is 12:25 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.