SA-MP Forums Archive
Does anyone else do this when scripting? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Does anyone else do this when scripting? (/showthread.php?tid=327417)



Does anyone else do this when scripting? - MP2 - 21.03.2012

I always write, for example

TogglePlayerControllabe();

then move my cursor back to between the brackets and type the parameters.

Is this just me?? It's actually a great habit and saves me lots of time, and it saves confusion if you have nested brackets:

pawn Код:
if(SetVehiclePos(GetPlayerVehicleID(GetSomeRandomPlayer(GetMaxPlayers()))))



Re: Does anyone else do this when scripting? - new121 - 21.03.2012

lol i do that on small bits but if i try with large amounts of code i wind up getting confused


Re: Does anyone else do this when scripting? - Alternative112 - 21.03.2012

I just write it all out...although there's nothing wrong with the way you do it. I find that it's faster if I type it out because I don't have to fiddle with my mouse, and it also makes me concentrate on what I'm doing more. Like new121 said, when you start getting lots of nested parenthesis, it can get confusing.


Re: Does anyone else do this when scripting? - ReneG - 21.03.2012

I do the same thing lol. I don't use my mouse though, I mainly navigate using the arrow keys. Reaching for the mouse slows me down.


Re: Does anyone else do this when scripting? - Skribblez - 21.03.2012

people use different methods and use it the most on which they think it's faster. it's also when they're used to it.

as for me, i haven't noticed how i type but i get them done in a short period of time.


Re: Does anyone else do this when scripting? - [ABK]Antonio - 21.03.2012

I do it with everything aside from {}'s

pawn Код:
MyThing()
{
    //i do this instead to get the template...
}
I do it that way because I think it's less confusing than

pawn Код:
MyThing(){
    //this stuff
}



Re: Does anyone else do this when scripting? - MP2 - 21.03.2012

Well yeah I do that too, I type

pawn Код:
stock somefunc(someargs)
{
}
then shove the code in after.

@Alternative112 Just press the left arrow key twice and you go from );x to x);

And yeah, nested parenthesis are a pain.

pawn Код:
new maxplayers = GetMaxPlayers();
new randplayer = GetRandomPlayer(maxplayers);
new vehicleid = GetPlayerVehicleID(randplayer);
if(SetVehiclePos(vehicleid))



Re: Does anyone else do this when scripting? - Spooky - 21.03.2012

I dont do it on functions, but i sometimes forget to define the sscanf uds's etc. Dont know what to say them.


Re: Does anyone else do this when scripting? - Infamous - 21.03.2012

I tend to click on the panel to the right in pawno and type the first few chars, then double click the function I want and type all the code in after.


Re: Does anyone else do this when scripting? - MP2 - 21.03.2012

Meh, I hide the function list, I would never use it, I know all the functions/callbacks now. I wouldn't be able to live without the parameter tooltip thing though where when you type "function(" and wait it shows the expected parameters if it's a native function.