How to work with "class"
#1

Hello,
I trying to used the methods of class C in PAWN
I wrote this script:
pawn Код:
#include <a_samp>

class A {//(3) : error 010: invalid function or declaration
    int alfa;
    float beta;
}

A x;//(8) : error 010: invalid function or declaration

main()
{
    x.alfa = 1;//12
    x.beta = 3.1;
}
And errors:
Quote:

C:\Users\Atoma_000\Desktop\samp03z\pawno\new.pwn(3 ) : error 010: invalid function or declaration
C:\Users\Atoma_000\Desktop\samp03z\pawno\new.pwn(8 ) : error 010: invalid function or declaration
C:\Users\Atoma_000\Desktop\samp03z\pawno\new.pwn(1 2) : error 017: undefined symbol "x"
C:\Users\Atoma_000\Desktop\samp03z\pawno\new.pwn(1 2) : error 029: invalid expression, assumed zero
C:\Users\Atoma_000\Desktop\samp03z\pawno\new.pwn(1 2) : error 017: undefined symbol "alfa"
C:\Users\Atoma_000\Desktop\samp03z\pawno\new.pwn(1 2) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Thanks for help.
Reply
#2

PAWN is not an object-oriented programming language. There is no concept of class in PAWN, sorry.
Reply
#3

i think that you need Latest Version of Sympol
try it and tell me
if i help you rep me
Reply
#4

http://www.compuphase.com/pawn/Pawn_Language_Guide.pdf
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)