[Ajuda] Duvida!
#1

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

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
Reply
#3

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;

Reply
#4

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.
Reply
#5

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.
Reply
#6

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.
Reply
#7

up? up ?
Reply
#8

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;
}
Reply
#9

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)