Problem with GM script
#1

Could someone please help me out with this error ? Iwas putting a FS into my GM and this is what's happen'.

Код HTML:
E:\Documents and Settings\Home\Desktop\Wherehouse Team Deathmatch\gamemodes\wh_tdm_gm.pwn(491) : error 017: undefined symbol "string"
E:\Documents and Settings\Home\Desktop\Wherehouse Team Deathmatch\gamemodes\wh_tdm_gm.pwn(503) : error 017: undefined symbol "PlayerInfo"
E:\Documents and Settings\Home\Desktop\Wherehouse Team Deathmatch\gamemodes\wh_tdm_gm.pwn(503) : warning 215: expression has no effect
E:\Documents and Settings\Home\Desktop\Wherehouse Team Deathmatch\gamemodes\wh_tdm_gm.pwn(503) : error 001: expected token: ";", but found "]"
E:\Documents and Settings\Home\Desktop\Wherehouse Team Deathmatch\gamemodes\wh_tdm_gm.pwn(503) : error 029: invalid expression, assumed zero
E:\Documents and Settings\Home\Desktop\Wherehouse Team Deathmatch\gamemodes\wh_tdm_gm.pwn(503) : fatal error 107: too many error messages on one line
Reply
#2

When you cut stuff out off a filterscript, make sure you cut everything.
Reply
#3

Post lines 491 and 503
Reply
#4

Well this is the whole FS starting from 482 to 519

Код HTML:
dcmd_register(playerid,params[])
{
        new file2[256],pname2[24];
        GetPlayerName(playerid, pname2, sizeof(pname2));
		format(file2, sizeof(file2), "Users/%s.sav", pname2);
		if(!strlen(params)){
			SendClientMessage(playerid, COLOR_ORANGE, "WARNING: /register [password]");
			return 1;}

		new File: file = fopen(string, io_append);
		if(file)
		{
			SendClientMessage(playerid, COLOR_ORANGE, "WARNING: This name is already registered. Usage /login [password]");
			fclose(file);
			return 1;
		}

		new File:hFile;
		hFile = fopen(file2, io_write);

		new var[64];
        PlayerInfo[playerid][Score] = GetPlayerScore(playerid);
        PlayerInfo[playerid][pAdminlevel] = 0;
        PlayerInfo[playerid][pLoggedin] = 1;
        PlayerInfo[playerid][pPassword2] = udb_hash(params);
        format(var, 64, "adminlevel=%d\n",PlayerInfo[playerid][pAdminlevel]);fwrite(hFile, var);
        format(var, 64, "password=%s\n",params);fwrite(hFile, var);
        format(var, 64, "hashPW=%d\n",PlayerInfo[playerid][pPassword2]);fwrite(hFile, var);
        //dini_Set(file2, "password", params);
		format(var, 64, "Kills=%d\n",PlayerInfo[playerid][GoodKillings]);fwrite(hFile, var);
		format(var, 64, "BadKills=%d\n",PlayerInfo[playerid][BadKillings]);fwrite(hFile, var);
        format(var, 64, "Deaths=%d\n",PlayerInfo[playerid][Deaths]);fwrite(hFile, var);
        format(var, 64, "Score=%d\n",PlayerInfo[playerid][Score]);fwrite(hFile, var);
        format(var, 64, "Logged=%d\n",PlayerInfo[playerid][pLoggedin]);fwrite(hFile, var);
		fclose(hFile);
		SendClientMessage(playerid,COLOR_LIGHTGREEN, "ACCOUNT: You are succesfully registered and logged in!!!");
		return 1;
}
Reply
#5

Instead of taking time with fopen etc, find dini and use it, super noob friendly, uses the same thing your using but with less code to use. Maybe that should help you out.
Reply
#6

Well I just don't get it... I'm trying to edit it somehow, well yea' nothin' happens.

Line 491 :

PHP код:
new Filefile fopen(stringio_append); 
Line 503 :
PHP код:
PlayerInfo[playerid][Score] = GetPlayerScore(playerid); 
Reply
#7

So... no nay answers for this ?
Reply
#8

You need Variable new string[128];
Reply
#9

Quote:
Originally Posted by RenisiL
Посмотреть сообщение
You need Variable new string[128];
And where shoult I put it ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)