SA-MP Forums Archive
[Help] OnDialogResponce +REP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] OnDialogResponce +REP (/showthread.php?tid=584726)



[Help] OnDialogResponce +REP - Andy5 - 07.08.2015

i was trying to make a neon System in My gamemode But when im trying to compile it gives me an errors

i will show You a part of My system



Код:
forward EnterExit1(playerid);

public OnGamemodeInit()
{
	SetTimer("EnterExit1", 2000, true);
	return 1;
}
Код:
public EnterExit1(playerid)
{
	if(IsPlayerInRangeOfPoint(playerid,3.0,2442.8745, 1292.1077, 10.3161))//neon garage
	{
		if(IsPlayerInAnyVehicle(playerid))
 		{
  			if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
			{
				SendClientMessage(playerid, COLOR_RED, "You are not the driver");
				return 1;
			}
			ShowPlayerDialog(playerid, neondialog, DIALOG_STYLE_LIST, "Neon Color", "DarkBlue (500$)\nRed (500$)\nGreen (500$)\nWhite (500$)\nViolet (500$)\nYellow (500$)\nCyan (500$)\nLightBlue (500$)\nPink (500$)\nOrange (500$)\nLightGreen (500$)\nLightYellow (500$)\nDelete Neon", "Select", "Cancel");
		}
		else
		{
		    SendClientMessage(playerid, COLOR_WHITE, " You are not in a vehicle");
	}
	return 1;
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

    if(dialogid == neondialog)
	{
		if(response)
		{
			if(listitem == 0)
			{
			    SetPVarInt(playerid, "Status", 1);
                SetPVarInt(playerid, "neon", CreateObject(18648,0,0,0,0,0,0));
                SetPVarInt(playerid, "neon1", CreateObject(18648,0,0,0,0,0,0));
                AttachObjectToVehicle(GetPVarInt(playerid, "neon"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "neon1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, COLOR_YELLOW, "You have successfully Changed your car neon.");
   			}
Errors !!

Код:
C:\Users\ma\Desktop\CBCN.pwn(52) : error 004: function "OnDialogResponse" is not implemented
C:\Users\ma\Desktop\CBCN.pwn(55) : error 017: undefined symbol "dialogid"
C:\Users\ma\Desktop\CBCN.pwn(57) : error 017: undefined symbol "response"
C:\Users\ma\Desktop\CBCN.pwn(59) : error 017: undefined symbol "listitem"
Anyone Help Me Please!!


Re: [Help] OnDialogResponce +REP - Vince - 07.08.2015

Missing brace. In EnterExit1 I count 5 opening braces but only 4 closing braces.


Re: [Help] OnDialogResponce +REP - Logofero - 07.08.2015

Quote:
Originally Posted by Andy5
Посмотреть сообщение
[B]

Код:
C:\Users\ma\Desktop\CBCN.pwn(52) : error 004: function "OnDialogResponse" is not implemented
C:\Users\ma\Desktop\CBCN.pwn(55) : error 017: undefined symbol "dialogid"
C:\Users\ma\Desktop\CBCN.pwn(57) : error 017: undefined symbol "response"
C:\Users\ma\Desktop\CBCN.pwn(59) : error 017: undefined symbol "listitem"
Anyone Help Me Please!!
Not finding function
Where do you call it then, but it is not in the code.

You have something forgot to add in the gamemod. look carefully


Re: [Help] OnDialogResponce +REP - Andy5 - 07.08.2015

Quote:
Originally Posted by Vince
Посмотреть сообщение
Missing brace. In EnterExit1 I count 5 opening braces but only 4 closing braces.
Which line >?


Re: [Help] OnDialogResponce +REP - Logofero - 07.08.2015

Try code

PHP код:
forward EnterExit1();
public 
OnGamemodeInit()
{
    
SetTimer("EnterExit1"2000true);
    return 
1;
}
public 
EnterExit1()
{
    for (new 
playeridplayerid MAX_PLAYERSplayerid++) {
        
        if(
IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid,3.0,2442.87451292.107710.3161))//neon garage
        
{
            if(
IsPlayerInAnyVehicle(playerid))
             {
                  if(
GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
                {
                    
SendClientMessage(playeridCOLOR_RED"You are not the driver");
                    return 
1;
                }
                
ShowPlayerDialog(playeridneondialogDIALOG_STYLE_LIST"Neon Color""DarkBlue (500$)\nRed (500$)\nGreen (500$)\nWhite (500$)\nViolet (500$)\nYellow (500$)\nCyan (500$)\nLightBlue (500$)\nPink (500$)\nOrange (500$)\nLightGreen (500$)\nLightYellow (500$)\nDelete Neon""Select""Cancel");
            }
            else
            {
                
SendClientMessage(playeridCOLOR_WHITE" You are not in a vehicle");
            }
        }
    
    }
    return 
1;
      




Re: [Help] OnDialogResponce +REP - Vince - 07.08.2015

Sometimes I can't even ... :fp:

I hope this is clear enough, otherwise I give up on humanity.




Re: [Help] OnDialogResponce +REP - Andy5 - 07.08.2015

Quote:
Originally Posted by Logofero
Посмотреть сообщение
Try code

PHP код:
forward EnterExit1();
public 
OnGamemodeInit()
{
    
SetTimer("EnterExit1"2000true);
    return 
1;
}
public 
EnterExit1()
{
    for (new 
playeridplayerid MAX_PLAYERSplayerid++) {
        
        if(
IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid,3.0,2442.87451292.107710.3161))//neon garage
        
{
            if(
IsPlayerInAnyVehicle(playerid))
             {
                  if(
GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
                {
                    
SendClientMessage(playeridCOLOR_RED"You are not the driver");
                    return 
1;
                }
                
ShowPlayerDialog(playeridneondialogDIALOG_STYLE_LIST"Neon Color""DarkBlue (500$)\nRed (500$)\nGreen (500$)\nWhite (500$)\nViolet (500$)\nYellow (500$)\nCyan (500$)\nLightBlue (500$)\nPink (500$)\nOrange (500$)\nLightGreen (500$)\nLightYellow (500$)\nDelete Neon""Select""Cancel");
            }
            else
            {
                
SendClientMessage(playeridCOLOR_WHITE" You are not in a vehicle");
            }
        }
    
    }
    return 
1;
      

Working , Thanks +REP