Problem with spawn - 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: Problem with spawn (
/showthread.php?tid=583840)
Problem with spawn -
SaVage96 - 31.07.2015
Код:
public OnPlayerSpawn(playerid)
{
new Query[500];
if(pInfo[playerid][Uj] == 0)
{
SetPlayerPos(playerid,-124.2139,1231.2828,18.6814);
SetPlayerFacingAngle(playerid,180.0000);
GivePlayerMoney(playerid,500);
format(Query, 500, "UPDATE `players` SET `Uj` = '1' WHERE `Uj` = '0' LIMIT 1"); //Format the query
mysql_query(Query);//425<-------------------
pInfo[playerid][Uj] = 1;
}
else
{
SetPlayerPos(playerid, pInfo[playerid][posX], pInfo[playerid][posZ], pInfo[playerid][posZ]);
}
return 1;
}
Код:
.pwn(425) : error 035: argument type mismatch (argument 1)
Thank you for help
Re: Problem with spawn -
Lunixx - 31.07.2015
Whats the line 425?
Re: Problem with spawn -
SaVage96 - 31.07.2015
mysql_query(Query);//425<-------------------
Re: Problem with spawn -
SaVage96 - 31.07.2015
Help
Respuesta: Problem with spawn -
Dreyfuz - 31.07.2015
mysql_query(conhandle, query[])
conhandle : The connection handle this will be processed on.
query[] : The query you want to execute.
Example:
PHP код:
new Cache:result = mysql_query(MySQL, "SELECT `Id` FROM `Users`");
printf("There are %d players in the database.", cache_num_rows());
cache_delete(result);
Re: Problem with spawn -
x3378 - 31.07.2015
Changes the first parameter(conhandle) by the variable that identifies your connection to the mysql database
pawn Код:
mysql_query(conhandle, Query, false);