I need a little bit help
#1

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)
Reply
#2

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

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

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

please help me
Reply
#6

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);
    }
  }
Reply
#7

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)