15.07.2014, 17:41
Hello guys, im started learning MySql and watched ******* video, but i got some errors.
And the code is here: (It's in estonia, sorry )
Код:
C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\fun.pwn(46) : error 035: argument type mismatch (argument 1) C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\fun.pwn(47) : error 017: undefined symbol "mysql_store_result" C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\fun.pwn(49) : error 017: undefined symbol "mysql_num_rows" C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\fun.pwn(241) : error 035: argument type mismatch (argument 1) C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\fun.pwn(242) : error 017: undefined symbol "mysql_store_result" C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\fun.pwn(244) : error 017: undefined symbol "mysql_num_rows" C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\fun.pwn(263) : error 035: argument type mismatch (argument 1) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 7 Errors.
pawn Код:
// MySql Fun Gamemode
#include <a_samp>
#include <sscanf>
#include <a_mysql>
#define SCM SendClientMessage
#define DIALOG_LOGI 0
#define DIALOG_REGA 1
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
public OnGameModeInit()
{
mysql_connect("localhost", "root", "Fun", "");
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
new query[126], lause[100], nimi[MAX_PLAYER_NAME];
GetPlayerName(playerid, nimi, sizeof(nimi));
format(query, sizeof(query), "SELECT * FROM kasutajad WHERE nimi = '%s'", nimi);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() == 1)
{
SCM(playerid, -1, "[ANDMEBAAS]: Selline kasutaja on meie andmebaasis kirjas! Palun logi sisse!");
format(lause, sizeof(lause), "Tere tulemast tagasi, %s!\n\nTeie kasutaja on meie andmebaasis kirjas, palun logige sisse!", nimi);
ShowPlayerDialog(playerid, DIALOG_LOGI, DIALOG_STYLE_PASSWORD, "Fun Server",lause,"Logi sisse","Lahku");
}
else
{
SCM(playerid, -1, "[ANDMEBAAS]: Selline kasutaja ei ole meie andmebaasis kirjas! Palun registreeri!");
format(lause, sizeof(lause), "Tere tulemast fun serverisse, %s!\n\nTeie kasutaja ei ole meie andmebaasis kirjas, palun registreerige!", nimi);
ShowPlayerDialog(playerid, DIALOG_REGA, DIALOG_STYLE_PASSWORD, "Fun Server",lause,"Registreeri","Lahku");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 0:
{
if(response)
{
new query[126], nimi[MAX_PLAYER_NAME];
GetPlayerName(playerid, nimi, sizeof(nimi));
format(query, sizeof(query), "SELECT * FROM kasutajad WHERE nimi = '%s' AND parool = '%s'", nimi, inputtext);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() == 1)
{
SCM(playerid, -1, "[SERVER]: Sa oled edukalt sisse logitud!");
}
else
{
SCM(playerid, -1, "[SERVER]: Sa kirjutasid vigase parooli!");
ShowPlayerDialog(playerid, DIALOG_LOGI, DIALOG_STYLE_PASSWORD, "Fun Server","Sa kirjutasid vigase parooli!\n\nProovi uuesti!","Logi sisse","Lahku");
}
}
}
case 1:
{
if(response)
{
new query[126], nimi[MAX_PLAYER_NAME];
GetPlayerName(playerid, nimi, sizeof(nimi));
format(query, sizeof(query), "INSERT INTO kasutajad VALUES ('%s', '%s')", nimi, inputtext);
mysql_query(query);
SCM(playerid, -1, "[SERVER]: Sinu kasutaja on edukalt registreeritud!");
}
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}