SA-MP Forums Archive
[Ajuda] erros - 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] erros (/showthread.php?tid=412042)



erros - gabrielloko157 - 31.01.2013

PHP код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#if defined FILTERSCRIPT
new event;
new 
Inevent;
public 
OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
"Filter Script Event By Gabrielloko157 =D");
    print(
"--------------------------------------\n");
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/criarevento"true))
    {
    for(new 
i=0iMAX_PLAYERSi++)
    {
         
ShowPlayerDialog(i,1923,DIALOG_STYLE_MSGBOX,"Evento Paintball","O Admin %s estб chamando todos Para um\n Evento de Paintball\n Vocк Deseja ir ?","Sim","Nгo");
    }
    }
    return 
0;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    {
        if(
Inevent == 1)
        {
        
SetPlayerPos(playerid,0.0,0.0,3.0);
        }
        
#endif
    
}
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
if(
dialogid == 1923){
    if(
response){
    
SetPlayerPos(playerid,0.0,0.0,3.0);
    
Inevent 1;
    }
    else{
    }
}
    return 
0// You MUST return 0 here! Just like OnPlayerCommandText.


eu to fazendo esse fs mais deu alguns erros alguem sabe o que pode ser ?


Re: erros - Falcon. - 31.01.2013

pawn Код:
#include <a_samp>

new bool:emEvento[MAX_PLAYERS];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/criarevento", true))
    {
        if(!IsPlayerAdmin(playerid)) return 0x00;

        static nome[21], fstring[79];
        GetPlayerName(playerid, nome, 21);
        format(fstring, 79 + 21, "O Admin %s estб chamando todos Para um\n Evento de Paintball\n Vocк Deseja ir ?", nome);

        for(new ii, xx = GetMaxPlayers(); ii != xx; ii++)
        {
            if(ii == playerid || !IsPlayerConnected(ii) /* || sua var de login == false */) continue;
            ShowPlayerDialog(ii, 1923, DIALOG_STYLE_MSGBOX, "Evento Paintball", fstring, "Sim", "Nгo");
        }
        return 0x01;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1923)
    {
        if(response)
        {
            emEvento[playerid] = true;
            SetPlayerPos(playerid,0.0,0.0,3.0);
        }
    }
    return 1;
}
para que esse SetPlayerPos em OnPlayerDeath o.х ?...


Re: erros - JonathanFeitosa - 31.01.2013

pawn Код:
#include <a_samp>


new event;
new Inevent;



public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("Filter Script Event By Gabrielloko157 =D");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/criarevento", true))
    {
       for(new i=0; i< MAX_PLAYERS; ++i)
       {
            ShowPlayerDialog(i,1923,DIALOG_STYLE_MSGBOX,"Evento Paintball","O Admin %s estб chamando todos Para um\n Evento de Paintball\n Vocк Deseja ir ?","Sim","Nгo");
       }
       return true;
    }
    return false;
}


public OnPlayerDeath(playerid, killerid, reason)
{
        if(Inevent == 1)
        {
             SetPlayerPos(playerid,0.0,0.0,3.0);
        }
        return 1;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
     if(dialogid == 1923){
          if(response){
                SetPlayerPos(playerid,0.0,0.0,3.0);
                Inevent = 1;
          }
    }
    return true;
}



Re: erros - gabrielloko157 - 31.01.2013

o Inevent identifica se ele foi pro evento, sendo assim se ele morrer ele volta pro evento
e o evento so vai fechar quando eu pedir =D

do Jhonathan deu Certo =D


ah e eu to com uma duvida,
como eu pego o id dos caras que foram pro evento e depois dar spaw so em quem tava no evento?

Usa o GetPlayerId e como eu vou dar respaw so em quem foi pro evento com um comando?


Re: erros - Falcon. - 31.01.2013

cara, quando morre nгo tem como setar posiзгo... voce simplesmente spawna novamente na posiзгo definida em AddPlayerClass ou SetSpawnInfo...

tanto o que voce postou antes quanto esse ai agora nao vai funcionar... voce estб usando uma unica variavel para todos os jogadores...


Ao menos de atenзгo ao que eu fiz e compare com o seu que notarб a diferenзa...


Re: erros - gabrielloko157 - 01.02.2013

Falcon, mais tem como eu usar addplayerclass usando a if Inevent ?