Originally posted by SnikerzHD
i am making my own v1 for ps3 and i need help with some functions can u help me anyone !!! :jim:
You haven't exactly been specific so I can't really offer you any specific guidance and the code required to make a function work correctly is different depending on A) where in your patch it is located B) What the function does C) Whether the function needs to be automatically called at the start of a game (or elsewhere), or whether you only want it to be called upon a certain event, for example, when you select that option from the mod menu.
I'll try explain the basic structure of your typical function and translate into plain english for you below;
// - these represent comments, so anything on a line with '//' is not to be interpretted as actual code.
//You can name a function whatever you like, you can name it rwefhberfbgtr if you so please, so for example, the below code will be God Mode, but you can still call the GodMode function rwefhberfbgtr if you want.
rwefhberfbgtr() //function name
{ //this symbol represents a BEGIN or START in plain english
} //this symbol represents an END or STOP in plain english
//So in plain English, your code now reads
FunctionName()
BEGIN doing stuff
END doing stuff
//Obviously there is no stuff to do in the above function, so this is where you add your actual code
rwefhberfbgtr() //function name
{ //this symbol represents a BEGIN or START in plain english
self endon ( "disconnect" );
self endon ( "death" );
self.maxhealth = 90000;
self.health = self.maxhealth;
while ( 1 )
{ //this symbol represents a BEGIN or START in plain english
wait .4;
if ( self.health < self.maxhealth )
self.health = self.maxhealth;
} //this symbol represents an END or STOP in plain english
} //this symbol represents an END or STOP in plain english
//Obviously for every '{' (or START) that you have, you also need a '}' (or STOP) to represent the end, it's pretty self explanitory when you think of it as 'this { symbol tells the computer running the code, that the code for the function which we have given the name rwefhberfbgtr begins here and } ends here'
//You can also add conditions to a function, so again using the example above
rwefhberfbgtr()
{
self endon ( "disconnect" );
self endon ( "death" );
self.maxhealth = 90000;
self.health = self.maxhealth;
while ( 1 )
{
wait .4;
if ( self.health < self.maxhealth )
self.health = self.maxhealth;
}
}
//This translates to;
rwefhberfbgtr()
BEGIN function
self endon ( "disconnect" );
self endon ( "death" );
self.maxhealth = 90000;
self.health = self.maxhealth;
While (1) // 1 meaning condition is true, 0 meaning false
BEGIN running code that you want to use whilst condition is true
wait .4;
if ( self.health < self.maxhealth )
self.health = self.maxhealth;
END running code that you want to use whilst condition is true
END function
This is very basic and i've tried to translate it to plain English as best as possible, although I appreciate that it may not be very clear at first, but if you read it a few times and then try write one yourself using the same logic, it should hopefully make sense.
Hope this helps