Help Variable
#1

Hello !
I have a question ..
I'm going to creat a system of actor , and my actor are going to had MAX_REP reply of 128 caraters(dynamic IG )
how to creat the variable ?

Thanks

PHP код:
aRep[MAX_REP][128
?

Thanks you
Reply
#2

I don't really understand what you mean with reply but try this:

#define MAX_REP 128 //PUT THIS ON TOP OF YOUR SCRIPT

Код:
new aRep[MAX_ACTORS][MAX_REP]
Reply
#3

No...
I have this enum
PHP код:
enum eActor {
    
aID,
    
aName[MAX_PLAYER_NAME],
    
aSkin,
    
Float:aPos[4],
    
aWorld,
    
aReply[MAX_REP],
     
aAnim 
}; 
So for example .. If I got next to an actor , it will say me a reply random
exemple :
"Hello"
"My name is X"
"see you soon"
When I have to save those 3 reply ?

Thanks
Reply
#4

Put this on top of your script:
Код:
#define MAX_REP 10 // The max amount of replies an actor can have. You can change this.
This is what your enum should look like:
Код:
enum eActor { 
    aID, 
    aName[MAX_PLAYER_NAME], 
    aSkin, 
    Float:aPos[4], 
    aWorld, 
    aReply[MAX_REP], 
     aAnim  
};

new Actors[MAX_ACTORS][eActor];
The string can be accessed by this: Actors[id of the actor][aReply][number of the actor's reply]

Example:
Код:
format(Actors[0][aReply][0], 128, "Welcome");
format(Actors[0][aReply][1], 128, "My name is Steve and I'm an actor with id 0");
format(Actors[0][aReply][2], 128, "This is my 3th reply");

new actormsg[128];
format(actormsg, sizeof(actormsg), "%s: %s", Actors[0][aName], Actors[0][aReply][0]);
SendClientMessage(playerid, -1, actormsg);
Reply
#5

Thanks a lot !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)