little problems.
#1

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(playeridpos[0], pos[1], pos[2]);
    
GetPlayerFacingAngle(playeridpos[3]); // getting and saving. 
PHP код:
mysql_format(MySQLquery,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
Reply
#2

"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
Reply
#3

I think.. like change

PHP код:
     Float:posX
    
Float:posY
    
Float:posZ
    
Float:posA 
to

PHP код:
      Floatpos[0], 
    
Floatpos[1], 
    
Floatpos[2], 
    
Floatpos[3
Reply
#4

Quote:
Originally Posted by SpikeSpigel
Посмотреть сообщение
I think.. like change

PHP код:
     Float:posX
    
Float:posY
    
Float:posZ
    
Float:posA 
to

PHP код:
      Floatpos[0], 
    
Floatpos[1], 
    
Floatpos[2], 
    
Floatpos[3
Yes , that will work i think
Reply
#5

Nope.. It says that is already in use.
Reply
#6

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.
Reply
#7

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 017undefined symbol "posX"
C:\Users\Modrogeanu\Desktop\Server\gamemodes\rp.pwn(348) : warning 213tag mismatch
C
:\Users\Modrogeanu\Desktop\Server\gamemodes\rp.pwn(349) : error 017undefined symbol "posY"
C:\Users\Modrogeanu\Desktop\Server\gamemodes\rp.pwn(349) : warning 213tag mismatch
C
:\Users\Modrogeanu\Desktop\Server\gamemodes\rp.pwn(350) : error 017undefined symbol "posZ"
C:\Users\Modrogeanu\Desktop\Server\gamemodes\rp.pwn(350) : warning 213tag mismatch
C
:\Users\Modrogeanu\Desktop\Server\gamemodes\rp.pwn(351) : error 017undefined symbol "posA"
C:\Users\Modrogeanu\Desktop\Server\gamemodes\rp.pwn(351) : warning 213tag mismatch
C
:\Users\Modrogeanu\Desktop\Server\gamemodes\rp.pwn(362) : error 017undefined symbol "posX"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
5 Errors

No errors. Idk what to do with this thing.. do you guys have any ideas ? :-s
Reply
#8

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 код:
      Floatpos[0], 
    
Floatpos[1], 
    
Floatpos[2], 
    
Floatpos[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(playeridpos[0], pos[1], pos[2]);
    
GetPlayerFacingAngle(playeridpos[3]); // getting and saving. 
PHP код:
mysql_format(MySQLquery,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()"
Reply
#9

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.
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)