Login - Register - OnPlayerConnect problem.
#1

Hello everyone, while I was working on MTA Deathmatch Race Gamemode script that was made by Hwang, I was adding a Login and Register system, and when I came to compile, I got these errors:
Код:
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\gamemodes\dmrace.pwn(352) : warning 225: unreachable code
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\gamemodes\dmrace.pwn(589) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\gamemodes\dmrace.pwn(589) : warning 215: expression has no effect
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\gamemodes\dmrace.pwn(589) : error 001: expected token: ";", but found "-string-"
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\gamemodes\dmrace.pwn(589) : warning 215: expression has no effect
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\gamemodes\dmrace.pwn(589) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\gamemodes\dmrace.pwn(589) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
My Code:
Код:
581-public OnPlayerConnect(playerid)
582-{
583-    new string[156], name[MAX_PLAYER_NAME];
584-    SendClientMessage(playerid, COLOR_MTA, "Welcome to pro Hunters [DD/DM] Training Server!");
585-	GetPlayerName(playerid, name, sizeof name);
586-    if(fexist(UserPath(playerid)))
587-	{
588-	    INI_ParseFile(UserPath(playerid), "LoadUser_%s");
589-	    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_WHITE"Login",""COLOR_WHITE"Type your password below to login.","Login","Quit");
590- 	}
591-  	else
592-   	{
593-	    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COLOR_WHITE"Registering...",""COLOR_WHITE"INFO: Type your password below to register to save your account's stats!","Register","Quit");
594- 	}
595-	format(string, sizeof string, "%s has joined this server.", name);
596-	SendClientMessageToAll(COLOR_MTA, string);
597	return 1;
598-}
Reply
#2

You got extra "}" after the code
PHP код:
596-    SendClientMessageToAll(COLOR_MTAstring);
597    return 1;
598-}//remove this 
Reply
#3

Quote:
Originally Posted by xTURBOx
Посмотреть сообщение
You got extra "}" after the code
PHP код:
596-    SendClientMessageToAll(COLOR_MTAstring);
597    return 1;
598-}//remove this 
But this closing the one in the second line, that was opened after OnPlayerConnects.
Reply
#4

You ShowPlayerDialog contains many (") that confuses the compiler and don't know which is the string, which is the color, use embed colors better

PHP код:
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT,"{FFFFFF}Login","{FFFFFF}Type your password below to login.","Login","Quit"); 
PHP код:
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT,"{FFFFFF}Registering...","{FFFFFF}INFO: Type your password below to register to save your account's stats!","Register","Quit"); 
Reply
#5

Quote:
Originally Posted by Shinja
Посмотреть сообщение
You ShowPlayerDialog contains many (") that confuses the compiler and don't know which is the string, which is the color, use embed colors better

PHP код:
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT,"{FFFFFF}Login","{FFFFFF}Type your password below to login.","Login","Quit"); 
PHP код:
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT,"{FFFFFF}Registering...","{FFFFFF}INFO: Type your password below to register to save your account's stats!","Register","Quit"); 
It confuses you, not the compiler. It is true that by convention "COLOR_" is defined as a hex color and not an embedded color. In this case, Shinja is right: you need embedded colors, which are by convention defined as "COL_" followed by the name.
Reply
#6

Hey , i guess you want to make a DM/DD training server for your clan from nd
I suggest you to not use hwang gamemode , make you own one from scratch , it's pain when you realise that the time you will take to make a new script is less than fixing hwang bugs , if you didn't test with someone yet , i will tell you that only id 0 spawn in the race , and spectating is bugged , velocities aren't working , there's many issues in the pickups , try playing a speed map and see how you will miss nos / rep pickups , good luck .
Reply
#7

Quote:
Originally Posted by AndySedeyn
Посмотреть сообщение
It confuses you, not the compiler. It is true that by convention "COLOR_" is defined as a hex color and not an embedded color. In this case, Shinja is right: you need embedded colors, which are by convention defined as "COL_" followed by the name.
Well i'm kinda right but i just don't explain it correctly
Reply
#8

Quote:
Originally Posted by houssam501
Посмотреть сообщение
Hey , i guess you want to make a DM/DD training server for your clan from nd
I suggest you to not use hwang gamemode , make you own one from scratch , it's pain when you realise that the time you will take to make a new script is less than fixing hwang bugs , if you didn't test with someone yet , i will tell you that only id 0 spawn in the race , and spectating is bugged , velocities aren't working , there's many issues in the pickups , try playing a speed map and see how you will miss nos / rep pickups , good luck .
I've tested it, and it's working fine, the only problems in the scripts include for MTA Maps right now is only the velocities and the spectating, plus no sounds for the pickups, which I am currently working on. Plus I am still trying to learn to make the include for MTA map loading, I'll try to find one on the forums and edit it and add some features in it, but remember I am still learning :c
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)