Pawn making new specifiers and Tags
#1

Hi im interested to know how i can create custom specifier in pawn i read panw implementers guide but i cant find anything valuable about it.And yeah also there is anything like typedef thing as in c++ in pawn to define new tags (i know pawn is typless but we can create new tags huh).Or we can just define it like this:
PHP Code:
new sometag:var; 
and will be a new tag?that part is also not understood from implementor's guide thats why im asking this.Thanks in advance.
Reply
#2

You can do that...but WHY?

This just gives you a huge of troubles...and it optimize nothing...
Reply
#3

I would appreciate if you share your knowledge. Im willing to take any trouble. But dont ask me why im doing this. I use pawn not just for samp but also for something else which i cant tell here. And i can also make use of it here too.
Reply
#4

Read this: https://sampwiki.blast.hk/wiki/Scripting:tags

If you have more questions, then you can ask here for more details
Reply
#5

Thanks but i already read it what im asking is can i create new tags and specifiers?
Creating tag can be just be done like this
PHP Code:
mytag:var; 
or is there any other function like typedef?
Reply
#6

No, there is no function (btw typedef is an operator).
So you have to do sth like this:

PHP Code:
new test:a;
//for functions where u allow only a specific tag:
func(test:x//If you give here a variable with another tag... = warning
{
    
}
//You can also do
func(x)
{
    new 
tmp tagof (x);
    if(
tmp == tagof (test:))
    {
        
//x is from type test
    
}
    else
    {
        
//Here its not
    
}

Reply
#7

Quote:
Originally Posted by Kaliber
View Post
No, there is no function (btw typedef is an operator).
So you have to do sth like this:

PHP Code:
new test:a;
//for functions where u allow only a specific tag:
func(test:x//If you give here a variable with another tag... = warning
{
    
}
//You can also do
func(x)
{
    new 
tmp tagof (x);
    if(
tmp == tagof (test:))
    {
        
//x is from type test
    
}
    else
    {
        
//Here its not
    
}

Thanks my doubt about tag cleared and yeah typedef is an operator my mistake.
Ok now about specifiers?
Reply
#8

Quote:
Originally Posted by GhostHacker
View Post
Ok now about specifiers?
What you wanna know about that?

Dont know what you mean exactly by this...
Reply
#9

Quote:
Originally Posted by Kaliber
View Post
What you wanna know about that?

Dont know what you mean exactly by this...
for eg in samp when SQLite introduced after some while a new specifier %q was introduced for db escape.that means a new specifier was added or created for samp. Another eg is specifier u for playerid and name in sscanf .Like that how can i create new one?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)