SA-MP Forums Archive
[Ajuda] Duvida! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Duvida! (/showthread.php?tid=397829)



Duvida! - jdsfenix - 07.12.2012

Como fazer pra Proibir que um player escreva algo no chat antes de ele escolher seu personagem ? antes de ele apertar Spawn ... alguem sabe ?


Re: Duvida! - lukas_loky - 07.12.2012

pawn Код:
new Spawnado[MAX_PLAYERS];
OnPlayerSpawn
{
 Spawnado[playerid] == 1;
resto
}
Onplayerdeath
{
Spawnado[playerid] == 0;
resto
}
OnPlayerDisconnect
{
Spawnado[playerid] == 0;
resto
}
OnPlayerText
{
     If(Spawnado != 1) { SendClientMessage(playerid,-1,"Vocк ainda nao fez spawn portanto nгo pode falar"); return 1; }
else
{
aзoes que tem no falar
}
Aqui tem o basico rs


Re: Duvida! - Schocc - 07.12.2012

PHP код:
//Topo do gm
new VarBlockMAX_PLAYERS ];
public 
OnPlayerConnectplayerid )
{
      
VarBlockplayreid ] = true;
      return 
true;
}
public 
OnPlayerTextplayeridtext[] )
{
      switch( 
VarBlockplayreid ] )
      {
            case 
0: return true;
            case 
1: return false;
      }
      return 
false;
}
public 
OnPlayerSpawnplayerid )
{
      
VarBlockplayreid ] = true;
      return 
true;




Re: Duvida! - jdsfenix - 07.12.2012

isso tbm blokeara a funзгo de ultilizar comandos ?

Deu esse erro quando testei o segundo codico
erro:
pawn Код:
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(302) : error 055: start of function body without function header
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(304) : error 010: invalid function or declaration
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(443) : error 055: start of function body without function header
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(444) : error 010: invalid function or declaration
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(446) : error 010: invalid function or declaration
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(447) : error 010: invalid function or declaration
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(449) : error 010: invalid function or declaration
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(731) : error 055: start of function body without function header
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(733) : error 010: invalid function or declaration
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(1369) : warning 203: symbol is never used: "VarBlock"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


9 Errors.



Re: Duvida! - zSuYaNw - 07.12.2012

pawn Код:
public OnPlayerConnect(playerid){
    SetPVarInt(playerid, "Lock", 0);
    return true;
}

public OnPlayerText( playerid, text[] )
{
    if(!GetPVarInt(playerid, "Lock")){
        return SendClientMessage(playerid, -1, "Vocк ainda nгo escolheu seu personagem, escolha para falar."), 0;
    }
   
    return false;
}

public OnPlayerSpawn( playerid )
{
    if(!GetPVarInt(playerid, "Lock")){
        SetPVarInt(playerid, "Lock", 1);
    }
   
    return true;
}

Para bloquear comandos, coloque:
pawn Код:
if(!GetPVarInt(playerid, "Lock")){
        return SendClientMessage(playerid, -1, "Vocк ainda nгo escolheu seu personagem, escolha para falar."), 0;
    }
No topo do OnPlayerCommandText.


Re: Duvida! - jdsfenix - 07.12.2012

deu isso garfield:
pawn Код:
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(300) : error 021: symbol already defined: "SetPVarInt"
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(301) : error 010: invalid function or declaration
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(441) : error 055: start of function body without function header
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(442) : error 010: invalid function or declaration
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(443) : error 010: invalid function or declaration
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(446) : error 010: invalid function or declaration
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(729) : error 055: start of function body without function header
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(730) : error 010: invalid function or declaration
C:\Users\cliente\Desktop\Nova pasta (2)\Brasil  Auto Estrada\gamemodes\BAE.pwn(734) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


9 Errors.



Re: Duvida! - jdsfenix - 07.12.2012

up? up ?


Re: Duvida! - Don_Speed - 07.12.2012

Bool \/
pawn Код:
#include a_samp
new bool:DonText[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
    DonText[playerid] = false;
    return 1;
}
public OnPlayerRequestSpawn(playerid)
{
    DonText[playerid] = true;
    return 1;
}
public OnPlayerText(playerid, text[])
{
    if(DonText[playerid] == false)return 0;
    return 0;
}



Re: Duvida! - Maklister - 07.12.2012

Quote:
Originally Posted by Schocc
Посмотреть сообщение
PHP код:
//Topo do gm
new VarBlockMAX_PLAYERS ];
public 
OnPlayerConnectplayerid )
{
      
VarBlockplayreid ] = true;
      return 
true;
}
public 
OnPlayerTextplayeridtext[] )
{
      switch( 
VarBlockplayreid ] )
      {
            case 
0: return true;
            case 
1: return false;
      }
      return 
false;
}
public 
OnPlayerSpawnplayerid )
{
      
VarBlockplayreid ] = true;
      return 
true;

Vocк ta colocando playreid invйs de playerid cuidado,

Falta o return 0; senгo ira imprimir a msg do mesmo jeito.