SendClientMessage only once
#1

Hey guys I got a question, when player registers I want to do a SendClientMessage ONLY once when he registers and he is spawned so for sure it will be placed in OnPlayerSpawn I think, so I got something like this


pawn Код:
SendClientMessage(playerid, COLOR_YELLOW, "You have received a phone from SoftBank type /myphonenumber to check your number!");
Is it possible to make it show only once when player registers and gets spawned and when he relogs it wont show again?
Reply
#2

Try under OnPlayerRegister to set that? :P
Reply
#3

pawn Код:
new Herro = 0;
forward BukLao ( ) ;
public OnPlayerSpawn(playerid) {
     Herro = 1;
     if(Herro == 1 ) {
         SendClientMessage(playerid, COLOR_YELLOW, "You have received a phone from SoftBank type /myphonenumber to check your number!");
     }
     SetTimer("BukLao",1000,false);
     return 1;
}
public BukLao ( ) {
    Herro = 0;
}

EDIT: Fixed code
Reply
#4

Quote:
Originally Posted by Kitten
Посмотреть сообщение
pawn Код:
new Herro = 0;
forward BukLao ( ) ;
public OnPlayerSpawn(playerid) {
     Herro = 1;
     if(Herro == 1 ) {
         SendClientMessage(playerid, COLOR_YELLOW, "You have received a phone from SoftBank type /myphonenumber to check your number!");
     }
     SetTimer("BukLao",1000,false);
     return 1;
}
public BukLao ( ) {
    Herro = 0;
}

EDIT: Fixed code
It still sends the message to players when they relog but what I ment is it will send to them on a first spawn then it wont anymore (I bet u know that anyways ^^.)
Reply
#5

Make a bool if they're already registered.
Reply
#6

I got it tho it shows a message when player does register in dialog it sends a message.

So he gets the message before he logs in... (which is not what I wanetd but I think I gotta go with it)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)