Jump to content
  • 0

Problema !


Shake

Question

Problema intalnita (descriere): Pai am inceput un Gamemode de la 0 si am o problema . Cand ma loghez pe server imi apare dialogul cu login / register dar jos in dreapta este un buton "Spawn" si daca dau pe el ma spawnaza la spawn si imi ramane dialogul . Cum sa fac cand dau click pe butonul "Spawn" sa ii dea kick sau sa nu poate face nimic ( inovensiv) . 
Ero(area / rile) / warning-(ul / urile): Nu sunt.
Liniile de cod / sursa / script-ul(obligatoriu): Nu cred ca trebuie
Imagini / Video (optional): 

http://s3.postimg.org/cr92moyyb/sa_mp_000.png
Ati incercat sa rezolvati singur?: Nu am nicio idee . Am cautat pe net dar nimic. Multumesc 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

Creezi o variabila 

gLogged [MAX_PLAYERS];

 

la OnplayerConnect

Setezi variabila 0 

 

Dupa ce raspunde la dialogul de login si e buna parola setezi variabila 1 dar o setezi inainte de SpawnPlayer (playerid);

 

 

Dupa la OnPlayerSpawn 

If (gLogged [playerid ] == 0)

{

SendClientMessage  (playerid, - 1, " ai primit kick pentru ca nu te-ai logat");

Kick (playerid);

Return 1;

}

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

Poti crea o variabila.. 

Sa zicem : 

new pLoggedIn[ MAX_PLAYERS ];

Aceasta variabila sa zicem ca se va seta " 1 " in momentul in care este actionat Butonul " Login " ( cand dialogul raspunde ).

Asadar, cand jucatorul se conecteaza va fi setata pe 0 pentru el:

public OnPlayerConnect(playerid)
{
    pLoggedIn[ playerid ] = 0;

    return ( 1 );
}


Dupa care.. 

public OnPlayerRequestSpawn(playerid)
{

  if ( pLoggedIn[ playerid ] =! 1 )
  {
         SendClientMessage(playerid, -1, "Nu te-ai logat inca! ");
        return ( 0 );
   }
   // Sau simplu .. fara mesaj:
    if ( pLoggedIn[ playerid ] == 0 )
       return ( 0 );

   // Nu mi se pare neaparat nevoie de Kick daca apasa acel buton fara login :-?.
}
Sper ca ti-am fost de ajutor, mult noroc :)!

Edited by blacklife.
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.