SA-MP Forums Archive
Scripting 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: Scripting help (/showthread.php?tid=78310)



Scripting help - Kanji_Suzuki - 18.05.2009

Hello
The script here is ment to remove the player if not the owner
that works ok but if you do owner the car it still removes the owner
Help me!!

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate==2)
	{
	  for(new i = 0; i < sizeof(CarInfo); i++)
	  {
	  	new newcar = GetPlayerVehicleID(playerid);
	  	new string[500];
	  	new Owner = CarInfo[i][cOwner];
    	if(newcar == CarInfo[i][ownedvehicle])
			{
			  if(CarInfo[i][cOwned]==0)
			  {
			    TogglePlayerControllable(playerid, 0);
			    CarOffered[playerid]=1;
			    format(string,sizeof(string),"~w~Car: %s~n~Price: ~g~%d~n~~w~/carbuy to buy this car",CarInfo[i][cDescription],CarInfo[i][cValue]);
					GameTextForPlayer(playerid,string,5000,5);
					return 1;
			  }
			  else if(Owner == playerid)
				{
				  SendClientMessage(playerid,Green,"Welcome back to your car");
				  return 1;
				}
			  else if(Owner !=playerid)
	  		{
	    		format(string,sizeof(string),"~b~this car is Owned by ~n~~w~ %s",CarInfo[i][cOwner]);
					GameTextForPlayer(playerid,string,5000,5);
 					RemovePlayerFromVehicle(playerid);
 					return 1;
				}
			}
		}
	}return 0;
}



Re: Scripting help - Kanji_Suzuki - 19.05.2009

Im Very sorry for dubble posting

but

i need someone to reply fast

im sorry for dubble posting