Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Inferno

#31

Intro
QuoteThis custom snippet, will count the number of checkpoints created in the Server. You can also set its type to make it execute something based on its type instead of its ID


Functions
function iCreateCheckpoint( player, world, isSphere, pos, argb, radius ) // create a cp, its same as default one, just add an 'i' in start
{
CreateCheckpoint(player, world, isSphere, pos, argb, radius);
CheckpointCount++;
cpType[CheckpointCount] =  null;
print("Checkpoint Created, Count: "+CheckpointCount+"");
}

function iDeleteCheckpoint( checkpoint ) // delete a cp
{
cpType[checkpoint.ID] = null;
checkpoint.Remove();
CheckpointCount--;
print(" Checkpoint Removed, Count : "+CheckpointCount+" ");
}

function SetCheckpointType( checkpoint, type ) { // sets cp type
local cp = FindCheckpoint(checkpoint);
if(cp) {
cpType[cp.ID] = type;
print("Checkpoint ID :"+cp.ID+" type set to "+type+" ");
}
}


OnScriptLoad
CheckpointCount <- -1;
 cpType <- array(2000,null);




Example

// OnScriptLoad
iCreateCheckpoint( null, 0, true, Vector(90.697, 278.878, 21.7719), ARGB(255, 255, 255, 255), 2.2); // golf cp
iCreateCheckpoint( null, 0, true, Vector(87.4472, -1453.78, 10.5655), ARGB(255, 255, 255, 255), 2.2); // pole cp
SetCheckpointType( 0, "golf" ); //  sets type
SetCheckpointType( 1, "pole" ); // same

// OnCheckpointEntered

function onCheckpointEntered( player, checkpoint )
{
if (cpType[checkpoint.ID] == "golf") {
Message("[#ffffff] Golf Club ");
}
else if(cpType[checkpoint.ID] == "pole") {
Message("[#ffff11] Pole Club ");
}   
}



Note
Quote~ There is another alternative to count the checkpoints as well, but i lost that snippet.
~ The checkpoint count will only increase or decrease upon using these custom functions and not for default ones, same goes for the checkpoint type thing
~ You can add more classes to execute checkpoint functions based on other things than ID, i.e pos, color etc


#32
Object Showroom / Re: Front Page Cafe
Jan 10, 2021, 05:57 PM
Accessible? Damn cool.
#33
Good work.
#34
Finally. Nice update
#35
Quote from: Mr.Dip 2020 on Dec 16, 2020, 04:41 PMdoes this mean we can host our server in the master list?

You just bumped a 5 years old post to ask that?
._.

Host Time is the uptime to check the time since when the server is up / hosted.

To show your server in masterlist, you need announce plugin and port forwarded internet ( if local hosted ) or VPS
#36
Good work
#37
Quote from: Ricardo Diaz on Dec 09, 2020, 09:04 AMCan I get server creator for 32 bit?
You mean server executable file and plugins for 32 bit? Sure
Here you go.

https://wiki.adtec.ovh
#38
https://forum.vc-mp.org/?board=11.0


Also stop asking people to make your scripts.
And dont be lazy to find the public posted scripts.
#39
Finally.

Good job doom
#40
Nice
#41
Support / Re: Question about player's marker
Nov 25, 2020, 06:45 AM
If you are giving an example of 2 groups, then SetShowOnlyTeamMarkers(true) is the only function that can be helpful for you.
#42
So would it cause more memory leaks than actual NewTimer?
#43
Quote from: Athanatos on Nov 23, 2020, 06:54 AMHaving a tick function IS ALWAYS better than timers. Timers are responsible for crashes and memory leaks. And that's a known fact.
Exactly, also it can be manually stopped/start using variables unlike timers which even can memory leaks upon starting/stopping.
#44
Quote from: KX on Nov 23, 2020, 01:46 AMbut why OnTimeChange when we can use a timer? I guess doing same thing with a timer is same unless you hate "newtimer" word :P

Having a tick function is more effecient in some cases over newTimer.

I had been using a bankcamp timer using NewTimer, and it used to kick me out of bank even when i left bank before 60s and enter at like 58 or 59s.
Since on Linus servers, its not preferred to kill timers.

Also as Shy mentioned above. Its just an example of How this can be as useful as NewTimer.

You can basically use this for any Continuous 1s interval timer. Or even others.
#45
Official wiki was down and i was using Thijn's one until the adtec one came.


There are many event functions which i recently came across


This OnTimeChange
And OnPlayerModuleList.