Help please cmds/dialog
#1

SATDM v9
I builded a mta and now im creating the pwn file.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{

if(IsPlayerInRangeOfPoint(playerid, 7.0, 1001.2708, -640.7729, 121.1328))
{
    ShowPlayerDialog(playerid,DIALOG_GATE, DIALOG_STYLE_INPUT, "GATE PASSWORD", "Enter your password below or die in 10s:", "OK", "LEAVE");
//	MoveObject(gate, 1011.79998779,-639.70001221,123.40000153, 2.00); //object(airportgate) (1)

	return 1;
}

if(strcmp(cmdtext,"/cg",true)==0)//opened
{
	MoveObject(gate, 1002.70001221,-643.79998779,123.40000153, 2.00); //object(airportgate) (1)
	return 1;
}
return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_GATE)
	{
        if(!response) // If they clicked 'Cancel' or pressed esc
        {
            SendClientMessage(playerid, COLOR_RED, "You dont know gate password | Killed in 10seconds.");
            SetTimerEx("DelayKillPlayer", 10000,0,"d",playerid);
        }
        else // Pressed ENTER or clicked 'Login' button
        {
            if(CheckPassword(playerid, inputtext))
            {
                SendClientMessage(playerid, COLOR_RED, "You sucessful entered the gate password!");
                SendClientMessage(playerid, COLOR_RED, "Gate will open now, To close it type /cg!");
                MoveObject(gate, 1011.79998779,-639.70001221,123.40000153, 2.00); //object(airportgate) (1)
			}
            else
            {
                SendClientMessage(playerid, COLOR_RED, "GATE LOGIN FAILED | Killed in 10seconds.");
                SetTimerEx("DelayKillPlayer", 10000,0,"d",playerid);
        	}
  		}
  		return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
	}
	return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}
and i get this error:
Код:
D:\GTASAN~1\SATDM~~1\FILTER~1\ErgiMh.pwn(139) : error 017: undefined symbol "CheckPassword"
pls tell me how to fix this and how to create a password for gate that i can put on dialog box and will open gate?
PLS HELP ME I WILL REP U OR DO A FAVour to u buT HELP ME
THANKS!
Reply
#2

You do not have CheckPassword defined.

Define it, like so:

pawn Код:
stock CheckPassword(playerid, password)
{
    if(!strcmp(password, "Thisisthepasswordyouwanttobecorrect", false))
    {
        return true;
    }
    return false;
}
Pretty sure this is the context you are trying to do it in. If the password equals the correct password, it will return 1, which will continue with the if statement.
Reply
#3

Kinderd this is my script now:

Код:
if(!strcmp(password, "ergi", false))
            {
                SendClientMessage(playerid, COLOR_RED, "You sucessful entered the gate password!");
                SendClientMessage(playerid, COLOR_RED, "Gate will open now, To close it type /cg!");
                MoveObject(gate, 1011.79998779,-639.70001221,123.40000153, 2.00); //object(airportgate) (1)
 			}
adn this is the error:
Код:
ErgiMh.pwn(139) : error 017: undefined symbol "password"
Reply
#4

pawn Код:
stock CheckPassword(playerid, password[])
{
    if(!strcmp(password, "ergi", false))
    {
        return true;
    }
    return false;
}
Password wasn't a string btw, forgot.

I have no idea why it says undefined symbol if you didn't remove password.

Ohh, and if you forgot how to use the stock, which you might have, do this:

pawn Код:
if(CheckPassword(playerid, passstring))
{
    //If he entered the password and got it correct, do something here
}
Reply
#5

pls add me on skype ergan.nano

and name Ergi Nano(yesiam) and try throught team viewer
Reply
#6

I'd rather not. People with sense can easily do what I just described.

If not, I'd just like to inform you that you should check with a hospital about your illness.
Reply
#7

ok thanks anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)