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



Ajuda com Checkpoint - R3C4LL - 12.11.2012

Код:
#include <a_samp>
#include <cpstream>

new assalto;

public OnGameModeInit()
{
    assalto = CPS_AddCheckpoint(153.1188,-64.5729,1.5781,2.0,100);
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    if(CPS_IsPlayerInCheckpoint(playerid,assalto))
    {
        SendClientMessage(playerid,0x008040AA,"Inicio de um assalto!");
        ShowPlayerDialog(playerid, 430, DIALOG_STYLE_MSGBOX,"Assalto", "Deseja fazer um assalto?", "Sim","Nao");
        return 1;
    }
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 430)
	{
	    if(response)
	    {
            SendClientMessage(playerid, -1, "vб atй o local marcado no mapa.");
            SendClientMessageToAll(-1, "um novo assalto foi iniciado \"/cop\" para detelo!");
		}
        return 1;
	}
	return 1;
}
Bom! funciona tudo direitinho atй CPS_IsPlayerInCheckpoint, aparece "Inicio de um assalto!" e o ShowPlayerDialog, mas quando vai selecionar a opзгo Sim ou Nгo ela nгo manda o comando para OnDialogResponse, q no caso era pra ficar assim: o player responde "sim" e aparecerб SendClientMessage, SendClientMessageToAll.

Jб fiz de tudo.

PS: nгo sei colocar pawn code.


Re: Ajuda com Checkpoint - R3C4LL - 12.11.2012

alguem?


Re: Ajuda com Checkpoint - Sergiinhonike - 12.11.2012

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 430)
    {
        if(
response == 1)
        {
            
SendClientMessage(playerid, -1"vб atй o local marcado no mapa.");
            
SendClientMessageToAll(-1"um novo assalto foi iniciado \"/cop\" para detelo!");
            return 
1;
        }
    }
    return 
1;

Tenta tambem por em macro o dialogid.. ou seilб..


Re: Ajuda com Checkpoint - R3C4LL - 12.11.2012

Quote:
Originally Posted by Sergiinhonike
Посмотреть сообщение
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 430)
    {
        if(
response == 1)
        {
            
SendClientMessage(playerid, -1"vб atй o local marcado no mapa.");
            
SendClientMessageToAll(-1"um novo assalto foi iniciado \"/cop\" para detelo!");
            return 
1;
        }
    }
    return 
1;

Tenta tambem por em macro o dialogid.. ou seilб..
nada ainda mano


Re: Ajuda com Checkpoint - Sergiinhonike - 12.11.2012

PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(
CPS_IsPlayerInCheckpoint(playerid,assalto))
    {
        
SendClientMessage(playerid,0x008040AA,"Inicio de um assalto!");
        
ShowPlayerDialog(playerid430DIALOG_STYLE_MSGBOX,"Assalto""Deseja fazer um assalto?""Sim","Nao");
        print(
"Tudo ok.\n");
        return 
1;
    }
    return 
1;

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    
printf("OnPlayerResponse(%i, %i, %i, %i, %s)"playeriddialogidresponselistiteminputtext);
    if(
dialogid == 430)
    {
        if(
response == 1)
        {
            
SendClientMessage(playerid, -1"vб atй o local marcado no mapa.");
            
SendClientMessageToAll(-1"um novo assalto foi iniciado \"/cop\" para detelo!");
            return 
1;
        }
    }
    return 
1;




Re: Ajuda com Checkpoint - R3C4LL - 12.11.2012

Quote:
Originally Posted by Sergiinhonike
Посмотреть сообщение
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(
CPS_IsPlayerInCheckpoint(playerid,assalto))
    {
        
SendClientMessage(playerid,0x008040AA,"Inicio de um assalto!");
        
ShowPlayerDialog(playerid430DIALOG_STYLE_MSGBOX,"Assalto""Deseja fazer um assalto?""Sim","Nao");
        print(
"Tudo ok.\n");
        return 
1;
    }
    return 
1;

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    
printf("OnPlayerResponse(%i, %i, %i, %i, %s)"playeriddialogidresponselistiteminputtext);
    if(
dialogid == 430)
    {
        if(
response == 1)
        {
            
SendClientMessage(playerid, -1"vб atй o local marcado no mapa.");
            
SendClientMessageToAll(-1"um novo assalto foi iniciado \"/cop\" para detelo!");
            return 
1;
        }
    }
    return 
1;

Nada ainda mano, parece ta tudo ok, jб procurei ver se num tinha conflito com outras coisas. Sу queria saber como isso pode acontece.


Re: Ajuda com Checkpoint - [Dark]Danny_Uchiha - 12.11.2012

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
 if(dialogid==430)
    {
        if(response==1)
        {
            SendClientMessage(playerid, -1, "vб atй o local marcado no mapa.");
            SendClientMessageToAll(-1, "um novo assalto foi iniciado \"/cop\" para detelo!");
        }
        return 1;
    }
    return 1;
}



Re: Ajuda com Checkpoint - Sergiinhonike - 12.11.2012

Olhou no console mano o que deu?


Re: Ajuda com Checkpoint - R3C4LL - 12.11.2012

deu Tudo ok. e mais nada


Re: Ajuda com Checkpoint - Sergiinhonike - 12.11.2012

OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]

O dialog aparece pra vocк?

Colcoa a funзгo pra destruir este cp, como se ele sу pudesse cometer um assalto uma por vez..