SA-MP Forums Archive
I need a little bit help - 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: I need a little bit help (/showthread.php?tid=51647)



I need a little bit help - kevin433 - 22.09.2008

hi,
I'm using lordscars and scriptet a little bit in there. But now i wan't to add carowners and this is my code:

Код:
for(new i=0;i<MAX_PLAYERS;i++)
  {
	new vehicleid = GetPlayerVehicleID(i);
  new ename[256];
  new name = GetPlayerName(playerid, ename, sizeof(ename));
	if(CarInfo[vehicleid][carsowner] = name)
	{
  CarInfo[carsid][carslocked] = 0;
  SetVehicleParamsForPlayer(vehicleid, playerid, 0, 0);
	}
	else
	{
	CarInfo[vehicleid][carslocked] = 1;
	SetVehicleParamsForPlayer(vehicleid, playerid, 0, 1);
	RemovePlayerFromVehicle(playerid);
	}
  }
And i get this error:

Код:
warning 211: possibly unintended assignment
on this line:
Код:
if(CarInfo[vehicleid][carsowner] = name)



Re: I need a little bit help - Donuts - 22.09.2008

Why dont you post it on the release thread god sakes...


Re: I need a little bit help - bogeymanEST - 22.09.2008

change
pawn Код:
if(CarInfo[vehicleid][carsowner] = name)
to
pawn Код:
if(CarInfo[vehicleid][carsowner] == name)



Re: I need a little bit help - kevin433 - 22.09.2008

Now it remove me from the vehicle and lock it even if i am the carowner :S


Re: I need a little bit help - kevin433 - 22.09.2008

please help me


Re: I need a little bit help - Donuts - 22.09.2008

pawn Код:
for(new i=0;i<MAX_PLAYERS;i++)
     {
       new vehicleid = GetPlayerVehicleID(i);
       new ename[256];      
       new name = GetPlayerName(i, ename, sizeof(ename));
       if(CarInfo[vehicleid][carsowner] == name)
       {
          CarInfo[vehicleid][carslocked] = 0;
          SetVehicleParamsForPlayer(vehicleid, i, 0, 0);
    }
    else
    {
         CarInfo[vehicleid][carslocked] = 1;
         SetVehicleParamsForPlayer(vehicleid, i, 0, 1);
    }
  }



Re: I need a little bit help - kevin433 - 22.09.2008

It works, but when i'm the carowner and exit the car it will lock the car for me too


Re: I need a little bit help - Softdrink - 13.02.2009

Yeah... this is the problem with locking...