Cannot get rid of the errors
#1

Script: From 0
Details: I made a PM system but seems i got an error that throws me...

CODES:

Код:
577	if (dialogid == 12581)
578	{	
579	if(!response) return 1;
580	if(!strlen(inputtext)) return SendClientMessage(playerid, COLOR_WHITE, "{FF1900}PM: {C3C3C3}Your message must contain characters!");
	581 new msg[255], pname[255];
	582 GetPlayerName(playerid, pname, 255);
	583 format(msg, 255, "{FF1900}PM from {C3C3C3}%s{FF1900}: {C3C3C3}%s", pname, inputtext);
	584 SendClientMessage(SendingPM[playerid], COLOR_WHITE, msg);
	585 }
	586 return 1;
587 }
588
589 public OnPlayerClickPlayer(playerid, clickedplayerid, source)
590 {
	591 ShowPlayerDialog(playerid, 12581, DIALOG_STYLE_INPUT, " ", "Please write a message below:", "Send", "Cancel"); 
	592 SendingPM[playerid] = clickedplayerid;
	593 return 1;
594 }
595
Line: 589 - Invalid expression, assumed zero
Line: 589 - function "OnPlayerClickPlayer" is not implemented
Line: 592 - undefined symbol "clickedplayerid"
Line: 595 - compound statement not closed at the end of file (starded at line 539)


NOTE: if dialogid starts from line 577!
Reply
#2

mind showing us the errors?
Reply
#3

Quote:
Originally Posted by SsHady
Посмотреть сообщение
mind showing us the errors?
Seems my pic wont work, wait a bit, im fixing it

EDIT : there u go the link
Reply
#4

EDIT:
put this above your onplayerclickplayer Callback
pawn Код:
forward OnPlayerClickPlayer(playerid, clickedplayerid, source);
\

also put this on top
pawn Код:
new clickedplayerid[MAX_PLAYERS]; // at the top
Reply
#5

Quote:
Originally Posted by SsHady
Посмотреть сообщение
EDIT:
put this above your onplayerclickplayer Callback
pawn Код:
forward OnPlayerClickPlayer(playerid, clickedplayerid, source);
\

also put this on top
pawn Код:
new clickedplayerid[MAX_PLAYERS]; // at the top
Putted errors, sorry im new here

EDIT: i did all that, same errors, but more of them but the same thing
Reply
#6

show us the code between
530 to where the dialog ends
Reply
#7

Quote:
Originally Posted by SsHady
Посмотреть сообщение
show us the code between
530 to where the dialog ends
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == 1)
    {
        new name[MAX_PLAYER_NAME], file[256], string[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), SERVER_USER_FILE, name);
        if(!response) return Kick(playerid);
        if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{C3C3C3}WoT Registration","{C3C3C3}Welcome to {FF1900}World of Tanks{C3C3C3}!\nWe see you are not {FF1900}registered{C3C3C3}!\nTo proceed, please {FF1900}register {C3C3C3}to our server!", "Register", "Odustani");
        dini_Create(file);
        dini_IntSet(file, "Password", udb_hash(inputtext));
        dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel] = 0);
        dini_IntSet(file, "Money",PlayerInfo[playerid][pCash] = 500);
        dini_IntSet(file, "Level",PlayerInfo[playerid][pScore] = 0);
        format(string, 128, "{FF1900}WoT: {C3C3C3}You have successfuly registered! NICK: {FF1900}%s {C3C3C3}| PASSWORD: {FF1900}%s", name, inputtext);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        gPlayerLogged[playerid] = 1;
    }
if (dialogid == 2)
	{
		new name[MAX_PLAYER_NAME], file[256];
		GetPlayerName(playerid, name, sizeof(name));
		format(file, sizeof(file), SERVER_USER_FILE, name);
		if(!response) return Kick(playerid);
		if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{C3C3C3}WoT Login", "{C3C3C3}Welcome! We see you are {FF1900}registered{C3C3C3}!\nTo proceed, please {FF1900}login {C3C3C3}to our server!", "Login", "Odustani");
		new tmp;
		tmp = dini_Int(file, "Password");
		if(udb_hash(inputtext) != tmp)
	   {
			SendClientMessage(playerid, COLOR_RED, "{FF1900}WoT: {C3C3C3}Bad login!");
			ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{C3C3C3}WoT Login", "{C3C3C3}Welcome to {FF1900}World of Tanks{C3C3C3}!\nWe see you are {FF1900}registered{C3C3C3}!\nTo proceed, please {FF1900}login {C3C3C3}to our server!", "Login", "Odustani");
	   }
		else
	   {
			gPlayerLogged[playerid] = 1;
			PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel");
			SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
			GivePlayerMoney(playerid, dini_Int(file, "Money")-GetPlayerMoney(playerid));
			SendClientMessage(playerid,COLOR_RED, "{FF1900}WoT: {C3C3C3}You have logged in!");
	   }
		if (dialogid == 12581)
		{	
		if(!response) return 1;
		if(!strlen(inputtext)) return SendClientMessage(playerid, COLOR_WHITE, "{FF1900}PM: {C3C3C3}Your message must contain characters!");
		new msg[255], pname[255];
		GetPlayerName(playerid, pname, 255);
		format(msg, 255, "{FF1900}PM from {C3C3C3}%s{FF1900}: {C3C3C3}%s", pname, inputtext);
		SendClientMessage(SendingPM[playerid], COLOR_WHITE, msg);
		}
		return 1;
	}

forward OnPlayerClickPlayer(playerid, clickedplayerid, source);
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	ShowPlayerDialog(playerid, 12581, DIALOG_STYLE_INPUT, "PM by Cyber", "Please write a message below:", "Send", "Cancel"); 
	SendingPM[playerid] = clickedplayerid;
	return 1;
}
Reply
#8

Aha your probably missing a bracket
fix it
Reply
#9

Quote:
Originally Posted by SsHady
Посмотреть сообщение
EDIT:
put this above your onplayerclickplayer Callback
pawn Код:
forward OnPlayerClickPlayer(playerid, clickedplayerid, source);
\

also put this on top
pawn Код:
new clickedplayerid[MAX_PLAYERS]; // at the top
Do you still have this line 'new clickedplayerid[MAX_PLAYERS];' that this retard suggested you add?
Reply
#10

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
Do you still have this line 'new clickedplayerid[MAX_PLAYERS];' that this retard suggested you add?
Yes i have...

EDIT: i deleted it, THANKS!! it works!!!! rep +
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)