#1

Hello everyone, I'm trying to learn to script and today I was facing a problem.

I wanted to create a dialog, which would flag a person when he has chosen the first option (0). But, I't gives me an error, to be sure I added the codes of the /flag command and the code I made.

The Error:
Код:
C:\Users\Vinay\Downloads\prestigerpnew.pwn(82173) : error 017: undefined symbol "giveplayerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
My code:
Код:
if(dialogid == 1992)
    {
        if(response)
        {
            if(listitem == 0)
            {
            SendClientMessage(playerid,COLOR_GREEN,"You have chosen a small house $500.000 has been taken from your pocket.");
            AddFlag(playerid, giveplayerid, "Small House");
            return 1;//Altijd op t einde
            }
		}
	}
The /flag code:
Код:
CMD:flag(playerid, params[])
{
	if (PlayerInfo[playerid][pAdmin] >= 2)
	{
		new string[128], giveplayerid, reason[64];
		if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /flag [playerid] [reason]");

		if(IsPlayerConnected(giveplayerid))
		{
			AddFlag(giveplayerid, playerid, reason);
			format(string, sizeof(string), "AdmCmd: %s was flagged by %s, reason: %s.", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
			ABroadCast(COLOR_LIGHTRED, string, 2);
			return 1;

		}
	}
	else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
	return 1;
}
Any help would be really appreciated!
Reply
#2

You haven't declared giveplayerid anywhere. At first, you need
pawn Код:
new giveplayerid;
Then, you need to assign a value to giveplayerid, but I can't really see what you have to add since you only provided the dialog code.
Reply
#3

Quote:
Originally Posted by Jari_Johnson*
Посмотреть сообщение
You haven't declared giveplayerid anywhere. At first, you need
pawn Код:
new giveplayerid;
Then, you need to assign a value to giveplayerid, but I can't really see what you have to add since you only provided the dialog code.
I want the player to be flagged, for "Small House".

Neither do I know what value I should give, giveplayerid. Thats why im asking it.

Thanks though!
Reply
#4

Hmm, can you explain the syntax of the Addflag(...,....,...); function?
Because, what I think, is the you can change giveplayerid to playerid. Once again, I'm not sure, but this is what I can understand.
Reply
#5

Quote:
Originally Posted by Jari_Johnson*
Посмотреть сообщение
Hmm, can you explain the syntax of the Addflag(...,....,...); function?
Because, what I think, is the you can change giveplayerid to playerid. Once again, I'm not sure, but this is what I can understand.
Код:
 AddFlag(playerid,adminid,reason[])
This is it, if im not wrong.
Reply
#6

could you give the code for the dialog? like showplayerdialog(blah blash..)... ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)