Welcome - NoN Repeat Message
#1

Hello.

So I tried to make a message OnPlayerSpawn which will come just the first time when the player spawns.

I've got here some code:

PHP код:
    new poruka[128],ime[MAX_PLAYER_NAME];
    if(
PPPP[playerid] == 1) return true;
    else if(
PPPP[playerid] == 0)
    {
        {
            
GetPlayerName(playerid,ime,sizeof(ime));
            
SendClientMessage(playerid,-1,"=================================================");
            
SendClientMessage(playerid,-1,"");
            
format(poruka,sizeof(poruka),"{00C0FF}WG:{FFFFFF} Dobrodosao,"COLOR_SIVA" %s {FFFFFF}na{28C1C9} WilderGaming Roleplay",ime);
            
SendClientMessage(playerid,-1,poruka);
            
SendClientMessage(playerid,-1,"{00C0FF}WG:{FFFFFF} Provjerite potpunu listu dostupnih komandi:"COLOR_LAGANA" /komande");
            
SendClientMessage(playerid,-1,"{00C0FF}WG:{FFFFFF} Uzivajte igraju na nasem serveru"COLOR_SIVA" -"COLOR_SVJETLO_PLAVA2" WG:RP Administracija");
            
SendClientMessage(playerid,-1,"");
            
SendClientMessage(playerid,-1,"=================================================");
            
PPPP[playerid] = 1;
        }
    } 
PPPP = Pokazi-Poruku-prvi-put // Show-Message-First-Time

And i doesn't work. I putted onto on...disconnect to save variable after using but nothing again.
Reply
#2

Can you show us the code where you save and load the PPPP variable ?
Reply
#3

I save it under OnPlayerDisconnect:

PPPP[playerid] = 1;
Reply
#4

Should I load it with pvar?
Reply
#5

Quote:
Originally Posted by NoDi522
Посмотреть сообщение
Should I load it with pvar?
You should load and save it just like pData.
And set the PPPP to 1 after sending the message not in OnPlayerDisconnect

EDIT: If you can show your OnPlayerConnect and OnPlayerDisconnect, I can write it for you.
Reply
#6

No reason to use a pVar, but are you sure it's saving correctly in the user file/database and loading correctly?
It's most likely a problem with your saving/loading.
Reply
#7

I am bit confused because i am still learning and you know...
So should i save it in something like enum or?

I just need a little explanation,you event don't have to give me a code. Just tell me 2-3 thing how to save and load those variables without errors in few words ?
Reply
#8

You don't need to set it in an enumerator, although it would be easier to reset.
But you have to save and load it like you save and load your enumerator arrays.
Reply
#9

Can you give me an example please?
It doesn't have to be with my code.
Reply
#10

You need a saving system for saving, you can use file systems or an SQL database, you would be better off looking at another script with a saving system or some tutorials if you don't know how to save/load.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)