Advertisement
jlalt

Lesson#1

Sep 21st, 2016
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.67 KB | None | 0 0
  1. #include <a_samp> // include samps defines & functions.
  2.  
  3. public OnFilterScriptInit() // being called when our script gets loaded!
  4. {
  5.     new myvar = MyFunction(2); // so now myvar var gots the value returned in MyFunction whic is 2 + 1 = 3
  6.     printf("%d",myvar); // use %d because myvar is integer | will print: 3
  7.     myvar = MyFunction(4); // so now myvar var gots the value returned in MyFunction whic is 4 + 1 = 5
  8.     printf("%d",myvar); // use %d because myvar is integer | will print: 5
  9. }
  10.  
  11. MyFunction(value) // a function we can call it whenever we want
  12. {
  13.     return ( value + 1 ) ; // so when this functions gets called the value which will return in it will be value + 1
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement