Problem with GM script -
Bilsg - 07.10.2010
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
Re: Problem with GM script -
Hash [NL-RP] - 07.10.2010
When you cut stuff out off a filterscript, make sure you cut everything.
Re: Problem with GM script -
willsuckformoney - 07.10.2010
Post lines 491 and 503
Re: Problem with GM script -
Bilsg - 07.10.2010
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;
}
Re: Problem with GM script -
willsuckformoney - 07.10.2010
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.
Re: Problem with GM script -
Bilsg - 07.10.2010
Well I just don't get it... I'm trying to edit it somehow, well yea' nothin' happens.
Line 491 :
PHP код:
new File: file = fopen(string, io_append);
Line 503 :
PHP код:
PlayerInfo[playerid][Score] = GetPlayerScore(playerid);
Re: Problem with GM script -
Bilsg - 08.10.2010
So... no nay answers for this ?
Re: Problem with GM script -
RenisiL - 08.10.2010
You need Variable new string[128];
Re: Problem with GM script -
Bilsg - 08.10.2010
Quote:
Originally Posted by RenisiL
You need Variable new string[128];
|
And where shoult I put it ?