[Plugin] [REL] Functions
#1

Functions
By Carlton
Information
I decided to go into Microsoft Visual c++, and thought about practicing c++. I'm not the best at c++. I'm purely a beginner at it, so I decided to start small and easy. I've made functions in c++. I've also used some of my PAWN functions i've posted before and converted them into c++.

Functions
There are about 36 functions you can use.
Code:
native IsACopSkin(_id);
native IsGangSkin(_id);
native IsBlackSkin(_id);
native IsAGirlFriendSkin(_id);
native IsAAztecaSkin(_id);
native IsAVagosSkin(_id);
native IsAGroveSkin(_id);
native IsABallasSkin(_id);
native IsAMeleeWeapon(_id);
native IsAExplosive(_id);
native IsAShotgun(_id);
native IsASMG(_id);
native IsARifle(_id);
native IsADisabledWeapon(_id);
native IsANangBoySkin(_id);
native IsABikerSkin(_id);
native IsAMafiaSkin(_id);
native IsAAgentSkin(_id);
native IsAMedicSkin(_id);
native IsAFiremanSkin(_id);
native IsAWhoreSkin(_id);
native IsABeachSkin(_id);
native IsARifaSkin(_id);
native IsAAirplane(_id);
native IsAHelicopter(_id);
native IsAAirVehicle(_id);
native IsABike(_id);
native IsABicycle(_id);
native IsAMotorBike(_id);
native IsABoat(_id);
native IsATrailer(_id);
native IsARCVehicle(_id);
native IsAValidVCom(_id);
native IsAValidWeapon(_id);
native IsAValidSkin(_id);
native IsAValidVehicleID(_id);
Credits
- Killerkid - Linux compiling.

Installation
- Insert FunctionAddon into the plugins folder.
- Add #include <Function_Addon.inc> into your script at the very top.

Download
Functions + Source Code.
Reply
#2

Quote:
Originally Posted by Seif_
This is great, I'm definitely going to use this for skins, thanks
Thank you.
Reply
#3

An optimisation of this plugin will be awsome ... :

First of all , why did you used charcater '_' ?

And at for loops , why at top of script , you didn't declared a s ?
int s;

In your plugin , you declared s for 22 times

And at arrays , it was so hard to count how much numbers did you wrote ?

pawn Code:
int Airplanes[] = {592,577,511,512,593,520,553,476,519,460,513};
int Airplanes[12] = {592,577,511,512,593,520,553,476,519,460,513}; /* 11 + 1 */
etc.
Reply
#4

Quote:
Originally Posted by Щә яә Ґя
An optimisation of this plugin will be awsome ... :

First of all , why did you used charcater '_' ?

And at for loops , why at top of script , you didn't declared a s ?
int s;

In your plugin , you declared s for 22 times

And at arrays , it was so hard to count how much numbers did you wrote ?

pawn Code:
int Airplanes[] = {592,577,511,512,593,520,553,476,519,460,513};
int Airplanes[12] = {592,577,511,512,593,520,553,476,519,460,513}; /* 11 + 1 */
etc.
Where did I use the character _?
( int IsAValidSkinID(int _id) { if(_id >= 0 && _id <= 28 return 1; return 0; } )
Why would it matter? It's just a underscore before the variable, it won't effect it at all. Also, the int s thing, i'll change around. In the arrays, why would it matter? It still did the same thing, sizeof(Airplanes), It was just easier.
Reply
#5

it would be better if you write it as a pawn scripting file (FS).
because :
1. new scripter who don't know c++ can edit/add/delete content of it easily.
2. there is nothing imposible to do the all of you did with pawn (in this case) so why not using pawn ?.
3. i didn't download or try it, but i think we have to load 2 files, one FS, and one plugin, so again why you made it as a plugin ?
4. it's also releated to scipting more than relating to a plugin.

finally the why i told that's is because plugins (with a little edit) can be dangerous (spyware, trojan , etc) but in pawn is imposible to do so.

BTW it's good which you share what you have with the peoples(i know you spend your time on it)
Reply
#6

Quote:
Originally Posted by Mina
it would be better if you write it as a pawn scripting file (FS).
because :
1. new scripter who don't know c++ can edit/add/delete content of it easily.
2. there is nothing imposible to do the all of you did with pawn (in this case) so why not using pawn ?.
3. i didn't download or try it, but i think we have to load 2 files, one FS, and one plugin, so again why you made it as a plugin ?
4. it's also releated to scipting more than relating to a plugin.

finally the why i told that's is because plugins (with a little edit) can be dangerous (spyware, trojan , etc) but in pawn is imposible to do so.

BTW it's good which you share what you have with the peoples(i know you spend your time on it)
Yes I know it can be edited easily, why would that matter? The plugin was made for fun, and to practice c++, even though all I did was make PAWN functions, then convert them. The third one, I have no idea what you're talking about. There's no statement on the topic saying you have to load a FS.

How can a little plugin be a virus, a couple of sentences you've said didn't make any sense at all.

Yes, I did spend my time on this, like I said though, it was just for practice.
Reply
#7

Quote:
Originally Posted by Carlton
Quote:
Originally Posted by Mina
it would be better if you write it as a pawn scripting file (FS).
because :
1. new scripter who don't know c++ can edit/add/delete content of it easily.
2. there is nothing imposible to do the all of you did with pawn (in this case) so why not using pawn ?.
3. i didn't download or try it, but i think we have to load 2 files, one FS, and one plugin, so again why you made it as a plugin ?
4. it's also releated to scipting more than relating to a plugin.

finally the why i told that's is because plugins (with a little edit) can be dangerous (spyware, trojan , etc) but in pawn is imposible to do so.

BTW it's good which you share what you have with the peoples(i know you spend your time on it)
Yes I know it can be edited easily, why would that matter? The plugin was made for fun, and to practice c++, even though all I did was make PAWN functions, then convert them. The third one, I have no idea what you're talking about. There's no statement on the topic saying you have to load a FS.

How can a little plugin be a virus, a couple of sentences you've said didn't make any sense at all.

Yes, I did spend my time on this, like I said though, it was just for practice.
Yes I know it can be edited easily, why would that matter? maybe for you it's not important but peoples like to do so, maybe a impovment, or a bug fix, so why not ?

The plugin was made for fun, and to practice c++, even though all I did was make PAWN functions, then convert them : yes that's good for a practice but look(peoples write plugins for something which it's imposible to do with pawn, like MySQL, Audio plugin, YSF, etc.) so i still say it's better release it as a FS. remember i didn't told you don't write it as a plugin(you can do what you want for practicing), i told if you gonna release it just do it as a FS.

The third one, I have no idea what you're talking about. There's no statement on the topic saying you have to load a FS. : well i guessed it (3. i didn't download or try it, but i think), BTW you are right in this case.

How can a little plugin be a virus : yes it can be, i'm not talking about your plugin, but you can see known viruses database to see there is a virus which is only about 8kb, it update itself from internet and download something with bigger size. as i said (with a little edit) can be dangerous ex: updating itself, and while updating downloading something else or uploading ...

a couple of sentences you've said didn't make any sense at all. : can you please exactly tell me which ? so i can explain ...
Reply
#8

Quote:
Originally Posted by Mina
Quote:
Originally Posted by Carlton
Quote:
Originally Posted by Mina
it would be better if you write it as a pawn scripting file (FS).
because :
1. new scripter who don't know c++ can edit/add/delete content of it easily.
2. there is nothing imposible to do the all of you did with pawn (in this case) so why not using pawn ?.
3. i didn't download or try it, but i think we have to load 2 files, one FS, and one plugin, so again why you made it as a plugin ?
4. it's also releated to scipting more than relating to a plugin.

finally the why i told that's is because plugins (with a little edit) can be dangerous (spyware, trojan , etc) but in pawn is imposible to do so.

BTW it's good which you share what you have with the peoples(i know you spend your time on it)
Yes I know it can be edited easily, why would that matter? The plugin was made for fun, and to practice c++, even though all I did was make PAWN functions, then convert them. The third one, I have no idea what you're talking about. There's no statement on the topic saying you have to load a FS.

How can a little plugin be a virus, a couple of sentences you've said didn't make any sense at all.

Yes, I did spend my time on this, like I said though, it was just for practice.
Yes I know it can be edited easily, why would that matter? maybe for you it's not important but peoples like to do so, maybe a impovment, or a bug fix, so why not ?

The plugin was made for fun, and to practice c++, even though all I did was make PAWN functions, then convert them : yes that's good for a practice but look(peoples write plugins for something which it's imposible to do with pawn, like MySQL, Audio plugin, YSF, etc.) so i still say it's better release it as a FS. remember i didn't told you don't write it as a plugin(you can do what you want for practicing), i told if you gonna release it just do it as a FS.

The third one, I have no idea what you're talking about. There's no statement on the topic saying you have to load a FS. : well i guessed it (3. i didn't download or try it, but i think), BTW you are right in this case.

How can a little plugin be a virus : yes it can be, i'm not talking about your plugin, but you can see known viruses database to see there is a virus which is only about 8kb, it update itself from internet and download something with bigger size. as i said (with a little edit) can be dangerous ex: updating itself, and while updating downloading something else or uploading ...

a couple of sentences you've said didn't make any sense at all. : can you please exactly tell me which ? so i can explain ...
You've explained them already, those were the virus talk, and number 3.
Reply
#9

Quote:
Originally Posted by Carlton
Quote:
Originally Posted by Mina
Quote:
Originally Posted by Carlton
Quote:
Originally Posted by Mina
it would be better if you write it as a pawn scripting file (FS).
because :
1. new scripter who don't know c++ can edit/add/delete content of it easily.
2. there is nothing imposible to do the all of you did with pawn (in this case) so why not using pawn ?.
3. i didn't download or try it, but i think we have to load 2 files, one FS, and one plugin, so again why you made it as a plugin ?
4. it's also releated to scipting more than relating to a plugin.

finally the why i told that's is because plugins (with a little edit) can be dangerous (spyware, trojan , etc) but in pawn is imposible to do so.

BTW it's good which you share what you have with the peoples(i know you spend your time on it)
Yes I know it can be edited easily, why would that matter? The plugin was made for fun, and to practice c++, even though all I did was make PAWN functions, then convert them. The third one, I have no idea what you're talking about. There's no statement on the topic saying you have to load a FS.

How can a little plugin be a virus, a couple of sentences you've said didn't make any sense at all.

Yes, I did spend my time on this, like I said though, it was just for practice.
Yes I know it can be edited easily, why would that matter? maybe for you it's not important but peoples like to do so, maybe a impovment, or a bug fix, so why not ?

The plugin was made for fun, and to practice c++, even though all I did was make PAWN functions, then convert them : yes that's good for a practice but look(peoples write plugins for something which it's imposible to do with pawn, like MySQL, Audio plugin, YSF, etc.) so i still say it's better release it as a FS. remember i didn't told you don't write it as a plugin(you can do what you want for practicing), i told if you gonna release it just do it as a FS.

The third one, I have no idea what you're talking about. There's no statement on the topic saying you have to load a FS. : well i guessed it (3. i didn't download or try it, but i think), BTW you are right in this case.

How can a little plugin be a virus : yes it can be, i'm not talking about your plugin, but you can see known viruses database to see there is a virus which is only about 8kb, it update itself from internet and download something with bigger size. as i said (with a little edit) can be dangerous ex: updating itself, and while updating downloading something else or uploading ...

a couple of sentences you've said didn't make any sense at all. : can you please exactly tell me which ? so i can explain ...
You've explained them already, those were the virus talk, and number 3.
okay BTW again thanks for sharing it, and it's really good for starting with C
good luck
Reply
#10

oh i got a suggestion for you too.

i would be better if you group similar functions to one.
for example: IsCopSkin, IsXXXSkin, if you see all of them is skin, so you can group them to one, like WhatIsSkin and return some value, ex: 1 for Cop, 2 for Doctor, etc.
if you did it don't forget to add defines too, ex: [Cop_Skin = value which you returned ] so we don't need to remember what id/number is Cop_Skin
Reply
#11

I don't understand why you complain about an "_" underscore infront of the variable name determining that its an local variable. Thats a habit of many programmers and is nothing new. Everybody may do it the way they want. There are ways to indicate it being the variable of the class itself if considered coding it in OOP. So people started using a "_" underscore to define a local variable. Lets give you an example in java as its the most easiest language to understand.

Код:
public class HelloWorldWithVariable
{
  int x;
  public static void main(String arg[])
  {
    SayIt("Hello World", 0);
  }
  public void SayIt(String str, int _x)
  {
    x = _x;
    System.out.println(str);
  }
  public void SayItEx(String str, int x)
  {
    this.x = x;
    System.out.println(str);
  }
}
So after all I dont see a problem. You don't have a problem with it either and NOTHING has to get on your nerves as you dont even have to care how its handled.
Reply
#12

Broken link...
Reply
#13

Anyone has a backup?
Reply
#14

Here's a mirror since the link is down.
http://www.epic-missions.com/Addon_Functions.rar
Reply
#15

Suggestion: IsAcceptedComponent(componentid, modelid);
Checks if the componentid can be added to the modelid.

Nice release btw!
Reply
#16

Quote:

Not Found

The requested URL /Addon_Functions.rar was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2 Server at www.epic-missions.com Port 80
Download link is still unavailable.
Reply
#17

Quote:
Originally Posted by Calgon
Посмотреть сообщение
Download link is still unavailable.
http://www.epic-missions.com/FunctionPlugin.rar
Reply
#18

Please, upload it again to another hosting comp. That one deletes your files.
Reply
#19

Any mirrors, please?

Thank you.
Reply
#20

Carlton is banned from the forums and has no way of re-uploading it to a new link. I asked him personally for the script, and he said he didn't have it anyway or something. There isn't going to be a new link up.

These functions are extremely simple to make in PAWN, so just re-create them. It would take you all of thirty minutes.
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)