S:\SAMP Stuff\ gamemodes\new.pwn(258) : error 029: invalid expression, assumed zero S:\SAMP Stuff\ gamemodes\new.pwn(258) : warning 217: loose indentation S:\SAMP Stuff\ gamemodes\new.pwn(258) : error 029: invalid expression, assumed zero S:\SAMP Stuff\ gamemodes\new.pwn(258) : error 029: invalid expression, assumed zero S:\SAMP Stuff\ gamemodes\new.pwn(258) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
public OnPlayerDataLoaded(playerid) { new rows,fields,row_count,field_count; row_count = cache_get_row_count(rows); field_count = cache_get_field_count(fields); if(!row_count) { //Line 258 here the error points. ShowPlayerDialog(playerid, Dialog_NoAcct, DIALOG_STYLE_MSGBOX, "Not Registerd on UCP, register there first.", "ok",""); Kick(playerid); } else { cache_get_field_content(0, "Pass", PlayerInfo[playerid][pPass], DBConnect, 1024); PlayerInfo[playerid][pID] = cache_get_field_content_int(0, "ID"); ShowPlayerDialog(playerid, Dialog_Login, DIALOG_STYLE_INPUT, "login", "enter password to login", "login", "quit"); } return 1; }
Hello I was working on a login system of my new GM which is MySQL Based. I followed tutorials on Forums to create a base login system to test if the way I am coding is correct. Now the problem is, that its giving me error on a weird line. I tried all possible things to prevent the error like writing same code in different ways but nothing worked. so I request some help. Thanks.
errors: Код:
S:\SAMP Stuff\ gamemodes\new.pwn(258) : error 029: invalid expression, assumed zero S:\SAMP Stuff\ gamemodes\new.pwn(258) : warning 217: loose indentation S:\SAMP Stuff\ gamemodes\new.pwn(258) : error 029: invalid expression, assumed zero S:\SAMP Stuff\ gamemodes\new.pwn(258) : error 029: invalid expression, assumed zero S:\SAMP Stuff\ gamemodes\new.pwn(258) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. Код:
public OnPlayerDataLoaded(playerid) { new rows,fields,row_count,field_count; row_count = cache_get_row_count(rows); field_count = cache_get_field_count(fields); if(!row_count) { //Line 258 here the error points. ShowPlayerDialog(playerid, Dialog_NoAcct, DIALOG_STYLE_MSGBOX, "Not Registerd on UCP, register there first.", "ok",""); Kick(playerid); } else { cache_get_field_content(0, "Pass", PlayerInfo[playerid][pPass], DBConnect, 1024); PlayerInfo[playerid][pID] = cache_get_field_content_int(0, "ID"); ShowPlayerDialog(playerid, Dialog_Login, DIALOG_STYLE_INPUT, "login", "enter password to login", "login", "quit"); } return 1; } |
cache_get_row_count(rows);
public OnPlayerDataLoaded(playerid)
{
new fields,row_count,field_count;
row_count = cache_get_row_count();
field_count = cache_get_field_count(fields);
if(!row_count)
{ //Line 258 here the error points.
ShowPlayerDialog(playerid, Dialog_NoAcct, DIALOG_STYLE_MSGBOX, "Not Registerd on UCP, register there first.", "ok","");
Kick(playerid);
}
else
{
cache_get_field_content(0, "Pass", PlayerInfo[playerid][pPass], DBConnect, 1024);
PlayerInfo[playerid][pID] = cache_get_field_content_int(0, "ID");
ShowPlayerDialog(playerid, Dialog_Login, DIALOG_STYLE_INPUT, "login", "enter password to login", "login", "quit");
}
return 1;
}
public OnPlayerDataLoaded(playerid)
{
if(!cache_get_row_count(DBConnect))
{
ShowPlayerDialog(playerid, Dialog_NoAcct, DIALOG_STYLE_MSGBOX, "Not Registerd on UCP, register there first.", "ok","");
Kick(playerid);
}
else
{
cache_get_field_content(0, "Pass", PlayerInfo[playerid][pPass], DBConnect, 1024); // Why 1024 characters?!
PlayerInfo[playerid][pID] = cache_get_field_content_int(0, "ID", DBConnect);
ShowPlayerDialog(playerid, Dialog_Login, DIALOG_STYLE_INPUT, "login", "enter password to login", "login", "quit");
}
return 1;
}
public OnPlayerDataLoaded(playerid)
{
new rows;
if(cache_get_row_count(rows))
{
if(!rows)
{
ShowPlayerDialog(playerid, Dialog_NoAcct, DIALOG_STYLE_MSGBOX, "Not Registerd on UCP, register there first.", "ok","");
Kick(playerid);
}
else
{
cache_get_value_name(0, "Pass", PlayerInfo[playerid][pPass], 1024); // Why 1024 characters?!
cache_get_value_name_int(0, "ID", PlayerInfo[playerid][pID]);
ShowPlayerDialog(playerid, Dialog_Login, DIALOG_STYLE_INPUT, "login", "enter password to login", "login", "quit");
}
}
return 1;
}
S:\SAMP Stuff\gamemodes\new.pwn(252) : error 001: expected token: "-identifier-", but found " " S:\SAMP Stuff\gamemodes\new.pwn(256) : error 010: invalid function or declaration S:\SAMP Stuff\gamemodes\new.pwn(268) : error 010: invalid function or declaration S:\SAMP Stuff\gamemodes\new.pwn(274) : error 001: expected token: "-identifier-", but found " " S:\SAMP Stuff\gamemodes\new.pwn(285) : error 010: invalid function or declaration S:\SAMP Stuff\gamemodes\new.pwn(288) : error 010: invalid function or declaration S:\SAMP Stuff\gamemodes\new.pwn(290) : error 010: invalid function or declaration S:\SAMP Stuff\gamemodes\new.pwn(340) : warning 217: loose indentation S:\SAMP Stuff\gamemodes\new.pwn(361) : error 001: expected token: "-identifier-", but found " " S:\SAMP Stuff\gamemodes\new.pwn(530) : error 001: expected token: "-identifier-", but found " " S:\SAMP Stuff\gamemodes\new.pwn(540) : error 010: invalid function or declaration 10 Errors.
public OnPlayerDataLoaded(playerid) //Line 252 { new rows; if(cache_get_row_count(rows)) //Line 256 { if(!rows) { ShowPlayerDialog(playerid, Dialog_NoAcct, DIALOG_STYLE_MSGBOX, "Not Registerd on UCP, register there first.", "ok",""); Kick(playerid); } else { cache_get_value_name(0, "Pass", PlayerInfo[playerid][pPass], 1024); // Why 1024 characters?! cache_get_value_name_int(0, "ID", PlayerInfo[playerid][pID]); ShowPlayerDialog(playerid, Dialog_Login, DIALOG_STYLE_INPUT, "login", "enter password to login", "login", "quit"); //Line 268 } } return 1; }
public OnAccountLoaded(playerid) //Line 274 { PlayerInfo[playerid][pLevel] = cache_get_field_content_int(0, "Level"); PlayerInfo[playerid][pCash] = cache_get_field_content_int(0, "Cash"); PlayerInfo[playerid][pBank] = cache_get_field_content_int(0, "Bank"); PlayerInfo[playerid][pPlayingHours] = cache_get_field_content_int(0, "Playing Hours"); PlayerInfo[playerid][pRepPoints] = cache_get_field_content_int(0, "Respect points"); PlayerInfo[playerid][pGender] = cache_get_field_content_int(0, "Gender"); PlayerInfo[playerid][pAge] = cache_get_field_content_int(0, "Age"); TogglePlayerSpectating(playerid, false); GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]); //Line 285 // SetSpawnInfo(playerid, 0, 23, Player[playerid][posX], Player[playerid][posY], Player[playerid][posZ], Player[playerid][posA], 0, 0, 0, 0, 0, 0); SpawnPlayer(playerid); //Line 288 SendClientMessage(playerid, -1, "You have successfully logged in."); //Line 290 return true; }
public OnPlayerDisconnect(playerid, reason) //Line 361 { new query[128], //Float:pos[4]; //GetPlayerPos(playerid, pos[0], pos[1], pos[2]); //GetPlayerFacingAngle(playerid, pos[3]); mysql_format(mysql, query, sizeof(query), "UPDATE `accounts` SET `Level` = %d, `Money` = %d, `Bank` = %d, `Playing Hours` = %d, `Respect Points` = %d WHERE `ID` = %d", PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pBank], PlayerInfo[playerid][pPlayingHours], PlayerInfo[playerid][pRepPoints], PlayerInfo[playerid][pID]); mysql_tquery(DBConnect, query, "", ""); return 1; }
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) //Line 530
GetPlayerName(playerid, playername, sizeof(playername)); //Line 540