[HELP] OnPlayerStateChange mysql problem help me please - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] OnPlayerStateChange mysql problem help me please (
/showthread.php?tid=269035)
[HELP] OnPlayerStateChange mysql problem help me please -
andruz99 - 14.07.2011
ok heres my OnPlayerStateChange
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new Autoid = GetPlayerVehicleID(playerid);
new string[128];
if(newstate == 2) //sхitja
{
// --------------------------------------------------------------------------------------------------------------- //
/*for(new m = 0; m < sizeof(MasinaInfo); m++)
{*/
// ------------------------------------- //
if(MasinaInfo[Autoid][MasinOstetud] == 0)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, PUNANE, "See masin on mььgis, Seda masinat ei tohiks olla!");
}
// ------------------------------------- //
// ------------------------------------- //
if(MasinaInfo[Autoid][MasinOstetud] == 1)
{
format(string,sizeof(string),"Sхiduki omanik: %s", MasinaInfo[Autoid][MasinOstetud]);
SendClientMessage(playerid, VALGE, string);
if(Kasutaja[playerid][MasinaV6ti] != Autoid)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, PUNANE, "Sul pole selle sхiduki vхtmeid!");
}
if(Kasutaja[playerid][MasinaV6ti] == Autoid)
{
SendClientMessage(playerid, VALGE, "See on sinu sхiduk!");
}
// ------------------------------------- //
/*}*/
// --------------------------------------------------------------------------------------------------------------- //
}
}
return 1;
}
Im using, mysql system loading the vehicles etc.. , everything works fine
but only that 1 thing...,
my vehicle MasinaInfo[playerid][OstetudMasin] is 1 , but it say's like its 0... even the mysql_log says that it has been loaded as 1
Runs this function , even if vehicle OstetudMasin enum is 1
Код:
if(MasinaInfo[Autoid][MasinOstetud] == 0)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, PUNANE, "See masin on mььgis, Seda masinat ei tohiks olla!");
}
Код:
[20:31:06] >> mysql_fetch_field_row( Connection handle: 1 )
[20:31:06] CMySQLHandler::FetchField("Ostetud") - 1
So what's the problem?
, loading saving, inserting works fine, only this thing.