Problem with IDs - 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 IDs (
/showthread.php?tid=594803)
Problem with IDs -
vinnythebest - 23.11.2015
Hello guys
I have made a my HQ System, but i have a problem.
I don't know why i can't make more id than 0.
This is my script:
Код:
stock AccendiVeicoloHQProprietario(playerid)
{
new nomeplayer2[24];
GetPlayerName(playerid, nomeplayer2, sizeof(nomeplayer2));
new vehicleid = GetPlayerVehicleID(playerid);
mysql_query("SELECT * FROM hq");
mysql_store_result();
new result[98], x;
while(mysql_retrieve_row())
{
mysql_get_field("hqID", result);
x = strval(result);
}
if(strcmp(PRVInfo[vehicleid][vProprietario], HQPlayer[x][hqNome]) == 0) //Se il veicolo ha il nome dell'HQ
{
if(strcmp(nomeplayer2, HQPlayer[x][hqProprietario]) == 0) //Se il nome del player и come il nome del proprietario dell'HQ
{
SendClientMessage(playerid, COLOR_RED, "Sei proprietario");
}
else
{
SendClientMessage(playerid, COLOR_RED, "NON sei proprietario");
}
}
return 1;
}
x is for ID of HQ's but only the 0 work and the ids 1-2-3-etc... don't work, i don't know why. But i need this script for make good.
"Sei proprietario" is good, i need it, but only with ID 0 work, the others ID are null.
I have the ID 1 HQ and this message don't show for no reason, how i can call all ids?
PS: Im sorry for my terrible english.
Re: Problem with IDs -
Yashas - 24.11.2015
Код:
while(mysql_retrieve_row())
{
mysql_get_field("hqID", result);
x = strval(result);
}
If I am not wrong, the rest of the code is supposed to be inside that loop.
Re: Problem with IDs -
vinnythebest - 11.12.2015
Im sorry for not reply but i have solved this, thanks anyway