![]() |
#31 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Aug 2009
Posts: 1,390
Reputation: 66
|
![]() |
![]() |
![]() |
![]() |
#32 |
Big Clucker
![]() ![]() Join Date: Apr 2008
Posts: 113
Reputation: 1
|
![]() Code:
SavePlayer(playerid) { if(!PlayerLogged[playerid]) return 0; UserStats[playerid][Money] = GetPlayerMoney(playerid); CheckMySQL(); new string[256]; format(string, sizeof(string), "UPDATE Users SET Password='%s',Admin='%d',Money='%d' WHERE Name='%s'", UserStats[playerid][Password], UserStats[playerid][Admin], UserStats[playerid][Money], UserStats[playerid][Name]); mysql_query(string); return 1; } Code:
C:\SA-MP servers\The Roleplay Server\gamemodes\MySQL.pwn(1183) : error 075: input line too long (after substitutions) C:\SA-MP servers\The Roleplay Server\gamemodes\MySQL.pwn(1184) : error 037: invalid string (possibly non-terminated string) C:\SA-MP servers\The Roleplay Server\gamemodes\MySQL.pwn(1184) : error 017: undefined symbol "UPDATE" C:\SA-MP servers\The Roleplay Server\gamemodes\MySQL.pwn(1184) : error 029: invalid expression, assumed zero C:\SA-MP servers\The Roleplay Server\gamemodes\MySQL.pwn(1184) : fatal error 107: too many error messages on one line my code: Code:
stock SavePInfo(playerid) { if(GetPVarInt(playerid, "LoggedIN") == 1) { new Query[600]; format(Query, sizeof(Query), "UPDATE `playerinfo` SET `kills` = %d, `deaths` = %d, `money` = %d, `Level` = %d, `Last Pos X` = %f, `Last Pos Y` = %f, `Last Pos Z` = %f, `Interior` = %d, `PMstatus` = %d, `Phonenumber` = %d, `Strength` = %d, `Jailtime` = %d, `Prisontime` = %d, `FactionID` = %d, `FactionRank` = %d, `FactionName` = %s, `RadioFreq` = %d, `PaycheckTime` = %d, `Gun0` = %d, `Gun1` = %d, `Gun2` = %d, `Gun3` = %d, `Gun4` = %d WHERE `user` = '%s'", // Also remember to update this... PVar[playerid][pKills], PVar[playerid][pDeaths], GetPlayerMoney(playerid), PVar[playerid][pAdminLevel], PVar[playerid][pLastX], PVar[playerid][pLastY], PVar[playerid][pLastZ], GetPlayerInterior(playerid), PVar[playerid][pPMstatus], PVar[playerid][pPhoneNumber], PVar[playerid][pStrentgh], PVar[playerid][pJailtime], PVar[playerid][pPrisontime], PVar[playerid][pFaction], PVar[playerid][pFactionRank], PVar[playerid][pFactionName], PVar[playerid][pRadioFrequency], PVar[playerid][pPaycheckTime], PVar[playerid][pGun0], PVar[playerid][pGun1], PVar[playerid][pGun2], PVar[playerid][pGun3], PVar[playerid][pGun4], pName(playerid)); new Query2[600]; format(Query, sizeof(Query), "UPDATE `playerinfo` SET `Ammo0` = %d, `Ammo1` = %d, `Ammo2` = %d, `Ammo3` = %d, `Ammo4` = %d, `IDnumber` = %d, `CarKey1` = %d, `Carkey2` = %d, `Carkey3` = %d,`WeaponLicense` = %d, `DrivingLicense` = %d, `Origin` = %d, `Sex` = %d, `BankPin` = %d, `Housekey1` = %d, `Housekey2` = %d, `Housekey3` = %d, `Bizkey1` = %d, `Bizkey2` = %d, `Bizkey3` = %d, `Rentkey` = %d, `Job` = %d, `Phonecontact1` = %d, `Phonecontact2` = %d, `Phonecontact3` = %d, `Phonecontact4` = %d WHERE `user` = '%s'", // Also remember to update this... PVar[playerid][pAmmo0], PVar[playerid][pAmmo1], PVar[playerid][pAmmo2], PVar[playerid][pAmmo3], PVar[playerid][pAmmo4], PVar[playerid][pIDnumber], PVar[playerid][pCarkey1], PVar[playerid][pCarkey2], PVar[playerid][pCarkey3], PVar[playerid][pWeaponLicense], PVar[playerid][pDrivingLicense], PVar[playerid][pOrigin], PVar[playerid][pSex], PVar[playerid][pBankpin], PVar[playerid][pHousekey1], PVar[playerid][pHousekey2], PVar[playerid][pHousekey3], PVar[playerid][pBizkey1], PVar[playerid][pBizkey2], PVar[playerid][pBizkey3], PVar[playerid][pRentkey], PVar[playerid][pJob], PVar[playerid][pPhoneContact1], PVar[playerid][pPhoneContact2], PVar[playerid][pPhoneContact3], PVar[playerid][pPhoneContact4], pName(playerid)); new Query3[600]; format(Query3, sizeof(Query3), "UPDATE `playerinfo` SET , `Phonecontact5` = %d, `Phonecontact6` = %d, `Phonecontact7` = %d, `Phonecontact8` = %d, `Phonecontact9` = %d, `Phonecontact10` = %d, `Phonecontact1` = %d, `Phonecontact11` = %d, `Phonecontact12` = %d, `Phonecontact13` = %d, `Phonecontact14` = %d, `Phonecontact15` = %d, `Jobcheckpoints` = %d, `Accent` = %d, `Virtualworld` = %d WHERE `user` = '%s'", // Also remember to update this... PVar[playerid][pPhoneContact5], PVar[playerid][pPhoneContact6], PVar[playerid][pPhoneContact7], PVar[playerid][pPhoneContact8], PVar[playerid][pPhoneContact9], PVar[playerid][pPhoneContact10], PVar[playerid][pPhoneContact11], PVar[playerid][pPhoneContact12], PVar[playerid][pPhoneContact13], PVar[playerid][pPhoneContact14], PVar[playerid][pPhoneContact15], PVar[playerid][pJobCheckpoints], PVar[playerid][pAccent], PVar[playerid][pVirtualWorld], pName(playerid)); mysql_query(Query); mysql_query(Query2); mysql_query(Query3); mysql_free_result(); return 1; } else return 0; } |
![]() |
![]() |
![]() |
#33 |
Huge Clucker
![]() ![]() ![]() Join Date: Aug 2011
Location: United States > California > Los Angeles County > Antellope Valley > Lancaster
Posts: 402
Reputation: 31
|
![]()
What about Floats? In the loading system.
|
![]() |
![]() |
![]() |
#34 |
Huge Clucker
![]() ![]() ![]() Join Date: Dec 2007
Posts: 207
Reputation: 0
|
![]()
I did it, but when i'm connected to my server, i have absolutely no message from your script
And if i do /register it does nothing i'm kinda lost |
![]() |
![]() |
![]() |
#35 |
Big Clucker
![]() ![]() Join Date: Feb 2012
Posts: 89
Reputation: 2
|
![]()
is it secured of injecting?
|
![]() |
![]() |
![]() |
#36 |
Little Clucker
![]() Join Date: Nov 2010
Posts: 22
Reputation: 0
|
![]()
this is just the worse... i can code in C++ and create my own scripts just fine, but when it comes to pawn..
well.. i fucking hate pawn.. |
![]() |
![]() |
![]() |
#37 |
Huge Clucker
![]() ![]() ![]() Join Date: Apr 2011
Posts: 407
Reputation: 5
|
![]()
Uhm, any help about the id? I mean, iv put on the table a column(idk if its a column) which was ids which it auto increments, but i dont know how to apply that to the sv =S, anyways, very useful tut. =)
|
![]() |
![]() |
![]() |
#38 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Jun 2009
Posts: 597
Reputation: 7
|
![]()
It's not working!
-When I enter the server and type /register (it doesn't matter did I type password or no) it tells me that I'm already registered! -When I login , I can do it with any password ! (for an example : I enter the server and type /login 1234 it shows me message that I'm succesfully logged in! When I restart the server and enter it again and type /login 123456 it again shows me that I'm succesfully logged in). -Also must it save the money ? Before restarting the server I had about 20k $ and when I restarted the server I had 0$.. (Is it not saving the data in database or I didn't make as it's shown ? |
![]() |
![]() |
![]() |
#39 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Jun 2012
Location: India
Posts: 864
Reputation: 290
|
![]()
error 017: undefined symbol "mysql_query"
Only "mysql_query" ,other functions work!! I am using R7 Windows Version of MySQL. |
![]() |
![]() |
![]() |
#40 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Jun 2009
Posts: 597
Reputation: 7
|
![]() |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|