Multiple functions in one line (is it possible?)
#1

I did this
PHP код:
new IP[16]; GetPlayerIp(playeridIPsizeof(IP)); 
and it returned no errors when I compiled.

Does this mean it's possible to use multiple functions in one line?
Reply
#2

i guess so..
Reply
#3

Technically your entire script is just one line.
Reply
#4

Quote:
Originally Posted by Sellize
Посмотреть сообщение
Does this mean it's possible to use multiple functions in one line?
Sure, you can do even this:

Код:
new x;
if(!x) print("hi"),print("hi again");
Reply
#5

Alright, learned something new then

Thanks!
Reply
#6

or i have antoher thing

PHP код:
#define \
            
SayText(%0,%1,%2);\
                
SendClientMessage(%0,%1,%2);\
                
SendClientMessage(%0,%1,%2);\
                
SendClientMessage(%0,%1,%2); 
PHP код:
SayText(playerid,color,text); 
PHP код:
#define \
            
MultipleOption(%0,%1,%2,%3,%4);\
                
SendClientMessage(%0,-1,%1);\
                
GivePLayerWeapon(%0,%2,%3);\
                
SetPlayerSkin(%0,%4); 
PHP код:
MultipleOption(playerid ,text ,weapon-id ,AMMO ,Skin-ID); 
^^
Reply
#7

Quote:
Originally Posted by ******
Посмотреть сообщение
That is a terrible way to write macros! You might want to read my pre-processor tutorial.
Honestly I have no idea what you are talking about, could you elaborate?
I took a look at that tutorial and don't see how it is relevant to this thread
Reply
#8

Quote:
Originally Posted by ******
Посмотреть сообщение
I was talking to Golf, the only person who posted a macro!
Oh, alright

Quote:
Originally Posted by ******
Посмотреть сообщение
For the orignal thread. Why did you make a thread asking if you could do something you already tried and had compile? That's basically, "hi, I've done this thing and it worked, does it work?"
Just to confirm, I guess.
Reply
#9

Prone to errors, though. If you do something like this:

pawn Код:
if(expresssion)
    foo(); bar();
Then bar() is unconditional.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)