Creating Classes in PAWNO? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Creating Classes in PAWNO? (
/showthread.php?tid=611287)
Creating Classes in PAWNO? -
Elie1996 - 04.07.2016
Hey, I'd like to create classes, like in other programming languages.
I've wanted this for a long time, so I thought I'd give it a shot now.
I need to do something like C++ for example:
class Cop {
private int rank;
private string signature;
// more properties...
//methods for Cop.
GetRank()
{
return rank;
}
// more methods...
}
int main()
{
Cop cop = new Cop();
int x = cop.GetRank();
printf("Your rank is $d.",x);
return 0;
}
anyone got any idea how to do this in PAWNO? I can't seem to find anything about making your own classes, nested classes, etc..
Re: Creating Classes in PAWNO? -
Vince - 04.07.2016
Pawn (not Pawno) is a strictly procedural language. So no, not possible. Regrettably.
Re: Creating Classes in PAWNO? -
Elie1996 - 04.07.2016
Right, PAWN, sorry.
That's quite a shame though, is there a way you (or anyone else) can think of to use linked lists or stacks or Queues at least?