Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: EK.IceFlake on Feb 09, 2015, 11:56 AM

Title: [HELP] Adding an instance function
Post by: EK.IceFlake on Feb 09, 2015, 11:56 AM
Is there any way possible to add a function based on instances? I mean like this:
native player::CustomKick(reason) MyCustomKickFunction(player, reason);
function MyCustomKickFunction(player, reason)
{
//etc...
}
Of couse this isnt a functional code, it is just to give you an idea on what I want
for example, based on the upper code, we can call FindPlayer("NE.CrystalBlue").CustomKick("this is a example not functional");
Thanks
Title: Re: [HELP] Adding an instance function
Post by: Fuzzie on Feb 09, 2015, 12:08 PM
Click here (http://vcmp.liberty-unleashed.co.uk/forum/index.php?topic=931.msg5495#msg5495)
Title: Re: [HELP] Adding an instance function
Post by: EK.IceFlake on Feb 09, 2015, 12:11 PM
Quote from: Fuzzie on Feb 09, 2015, 12:08 PMClick here (http://vcmp.liberty-unleashed.co.uk/forum/index.php?topic=931.msg5495#msg5495)
Thanks. Btw isnt it so very similar to my example :P
Title: Re: [HELP] Adding an instance function
Post by: Gudio on Feb 09, 2015, 12:36 PM
function CPlayer::CustomKick( reason )
{
::Message("Player " + Name + " was kicked for " + reason);
Kick();
}

:P
Title: Re: [HELP] Adding an instance function
Post by: . on Feb 09, 2015, 01:23 PM
Quote from: Gudio on Feb 09, 2015, 12:36 PMfunction CPlayer::CustomKick( reason )
{
....
}

:P

*cough* "CPlayer_INTERNAL" :P And also this (http://www.squirrel-lang.org/doc/squirrel3.html#d0e1580).
Title: Re: [HELP] Adding an instance function
Post by: Sk on Feb 10, 2015, 12:47 PM
was off topic so moved here (http://forum.vc-mp.org/?topic=257)