little problems. -
SpikeSpigel - 06.08.2015
Hi there, I have a problem with my database.. (again) . I have made that when you register to spawn you on the player spawn, ok, working perfectly, then I made that when a player disconects to save it's location and import it in the database so when the player connects back he is spawned at the place where he crashed or quit. but.. when I exit the location isn't saved in the database. But it's working, selecting and everything. I hav added some location directly in database to see if it's selecting from it and inserting in the server, it's working for that. But not saving the location on exit..
This is a part of my enum
PHP код:
Float:posX,
Float:posY,
Float:posZ,
Float:posA
and this is the OnPlayerDisconnect function to save..
PHP код:
new query[128], Float:pos[4];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerFacingAngle(playerid, pos[3]); // getting and saving.
PHP код:
mysql_format(MySQL, query,sizeof query,"UPDATE `accounts` SET `Admin` = %d, `Tester` = %d, `Money` = %d, `PosX` = %f, `PosY` = %f, `PosZ` = %f, `PosA` = %f WHERE `ID`=%d", Player[playerid][Admin], Player[playerid][Tester], GetPlayerMoney(playerid), pos[0], pos[1], pos[2], pos[3], Player[playerid][ID]); // and all the update function..
so.. what I did wrong ? And how can I repair it ? :-s
Re: little problems. -
Mariciuc223 - 06.08.2015
"Float: posX, Float: posY ...." it's diferent from "Float: pos[4];"
You need to put in enum Float: pos[4] , or you need to put there where you get player pos , "Float: posX..."
You understand my bad english ? :P
Re: little problems. -
SpikeSpigel - 06.08.2015
I think.. like change
PHP код:
Float:posX,
Float:posY,
Float:posZ,
Float:posA
to
PHP код:
Float: pos[0],
Float: pos[1],
Float: pos[2],
Float: pos[3]
Re: little problems. -
Mariciuc223 - 06.08.2015
Quote:
Originally Posted by SpikeSpigel
I think.. like change
PHP код:
Float:posX,
Float:posY,
Float:posZ,
Float:posA
to
PHP код:
Float: pos[0],
Float: pos[1],
Float: pos[2],
Float: pos[3]
|
Yes , that will work i think
Re: little problems. -
SpikeSpigel - 06.08.2015
Nope.. It says that is already in use.
Re: little problems. -
MarvinPWN - 06.08.2015
If you don't use this:
PHP код:
Float:posX,
Float:posY,
Float:posZ,
Float:posA
you can delete this.
When you get errors you should add this again.
Re: little problems. -
SpikeSpigel - 06.08.2015
Quote:
Originally Posted by MarvinPWN
If you don't use this:
PHP код:
Float:posX,
Float:posY,
Float:posZ,
Float:posA
you can delete this.
When you get errors you should add this again.
|
PHP код:
C:\Users\Modrogeanu\Desktop\Server\gamemodes\rp.pwn(348) : error 017: undefined symbol "posX"
C:\Users\Modrogeanu\Desktop\Server\gamemodes\rp.pwn(348) : warning 213: tag mismatch
C:\Users\Modrogeanu\Desktop\Server\gamemodes\rp.pwn(349) : error 017: undefined symbol "posY"
C:\Users\Modrogeanu\Desktop\Server\gamemodes\rp.pwn(349) : warning 213: tag mismatch
C:\Users\Modrogeanu\Desktop\Server\gamemodes\rp.pwn(350) : error 017: undefined symbol "posZ"
C:\Users\Modrogeanu\Desktop\Server\gamemodes\rp.pwn(350) : warning 213: tag mismatch
C:\Users\Modrogeanu\Desktop\Server\gamemodes\rp.pwn(351) : error 017: undefined symbol "posA"
C:\Users\Modrogeanu\Desktop\Server\gamemodes\rp.pwn(351) : warning 213: tag mismatch
C:\Users\Modrogeanu\Desktop\Server\gamemodes\rp.pwn(362) : error 017: undefined symbol "posX"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
No errors. Idk what to do with this thing.. do you guys have any ideas ? :-s
Re: little problems. -
xVIP3Rx - 06.08.2015
Quote:
Originally Posted by Mariciuc223
Yes , that will work i think
|
Quote:
Originally Posted by SpikeSpigel
I think.. like change
PHP код:
Float:posX,
Float:posY,
Float:posZ,
Float:posA
to
PHP код:
Float: pos[0],
Float: pos[1],
Float: pos[2],
Float: pos[3]
|
Quote:
Originally Posted by Mariciuc223
"Float: posX, Float: posY ...." it's diferent from "Float: pos[4];"
You need to put in enum Float: pos[4] , or you need to put there where you get player pos , "Float: posX..."
You understand my bad english ? :P
|
Quote:
Originally Posted by MarvinPWN
If you don't use this:
PHP код:
Float:posX,
Float:posY,
Float:posZ,
Float:posA
you can delete this.
When you get errors you should add this again.
|
Are you kidding me, if you don't know what is the problem don't post bullshit.
Quote:
Originally Posted by SpikeSpigel
Hi there, I have a problem with my database.. (again) . I have made that when you register to spawn you on the player spawn, ok, working perfectly, then I made that when a player disconects to save it's location and import it in the database so when the player connects back he is spawned at the place where he crashed or quit. but.. when I exit the location isn't saved in the database. But it's working, selecting and everything. I hav added some location directly in database to see if it's selecting from it and inserting in the server, it's working for that. But not saving the location on exit..
This is a part of my enum
PHP код:
Float:posX,
Float:posY,
Float:posZ,
Float:posA
and this is the OnPlayerDisconnect function to save..
PHP код:
new query[128], Float:pos[4];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerFacingAngle(playerid, pos[3]); // getting and saving.
PHP код:
mysql_format(MySQL, query,sizeof query,"UPDATE `accounts` SET `Admin` = %d, `Tester` = %d, `Money` = %d, `PosX` = %f, `PosY` = %f, `PosZ` = %f, `PosA` = %f WHERE `ID`=%d", Player[playerid][Admin], Player[playerid][Tester], GetPlayerMoney(playerid), pos[0], pos[1], pos[2], pos[3], Player[playerid][ID]); // and all the update function..
so.. what I did wrong ? And how can I repair it ? :-s
|
Nothing seems to be wrong in this code, post the log from "mysql_log.txt.", and if it isn't there put "mysql_log( LOG_ALL );" under "OnGameModeInit()"
Re: little problems. -
MarvinPWN - 07.08.2015
Quote:
Originally Posted by xVIP3Rx
Are you kidding me, if you don't know what is the problem don't post bullshit.
|
Shut up. Each person can do a mistake, so be quiet.
Re: little problems. -
xVIP3Rx - 07.08.2015
Right, but I said if you don't know what you're talking about don't post, and all of those posts were not mistakes, but totally not knowing what is the problem, especially yours
Quote:
Originally Posted by MarvinPWN
If you don't use this:
PHP код:
Float:posX,
Float:posY,
Float:posZ,
Float:posA
you can delete this.
When you get errors you should add this again.
|
you want him to remove the actual enum that saves data and "if errors happen" add it again, yeah that was obviously a mistake, I apologize, and thanks for the respectful post.
I appreciate all of your attempts to help him, but I dislike people who post just for a rep or who post something totally not related to the problem.