SA-MP Forums Archive
MySQL Faction System - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL Faction System (/showthread.php?tid=646504)



MySQL Faction System - tbedy - 17.12.2017

Код:
C:\Users\Toni\Desktop\aaaaaaaaaaa\gamemodes\ALRPDM22.pwn(8831) : error 017: undefined symbol "playername"
C:\Users\Toni\Desktop\aaaaaaaaaaa\gamemodes\ALRPDM22.pwn(8831) : error 017: undefined symbol "playername"
C:\Users\Toni\Desktop\aaaaaaaaaaa\gamemodes\ALRPDM22.pwn(8831) : error 029: invalid expression, assumed zero
C:\Users\Toni\Desktop\aaaaaaaaaaa\gamemodes\ALRPDM22.pwn(8831) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Код:
    // probajen factions
    GetPlayerName(playerid, playername, sizeof(playername)); //You still have to create the variable playername
	format(string, sizeof(string), "UPDATE `table` SET factionid = %i, rank = %i WHERE Username = %s", pData[playerid][Faction], pData[playerid][Rank], playername); //Updating mysql database with facitonid/rank
	mysql_query(string); //Sending the query.  Remember, must still create the variable "string"
	// =====
+

if someone can help me with making saving system for these factions!?

Need to create table first or?


Re: MySQL Faction System - DelK - 18.12.2017

Yes, you need to create the table if you do not create it will result in an error in the log.
PHP код:
        new playername[30];   
        
GetPlayerName(playeridplayernamesizeof(playername)); //You still have to create the variable playername
    
format(stringsizeof(string), "UPDATE `table` SET factionid = %i, rank = %i WHERE Username = %s"pData[playerid][Faction], pData[playerid][Rank], playername); //Updating mysql database with facitonid/rank
    
mysql_query(string); //Sending the query.  Remember, must still create the variable "string"