SA-MP Forums Archive
Vehicle system. 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: Vehicle system. Help (/showthread.php?tid=245447)



Vehicle system. Help - gedux123775 - 31.03.2011

I am using a system where you can have one car, but I want to do that you can have two. And puts on only one car. How to do that puts two cars? This is a bad scripts. Thanks!!
Код:
stock Check(playerid)
{
	if(IsPlayerConnected(playerid))
	{
	    for(new i = 1; i < sizeof(CarInfo); i++)
	    {
	        new playername[MAX_PLAYER_NAME];
	        GetPlayerName(playerid,playername,sizeof(playername));
	        if(strcmp(playername,CarInfo[i][cOwner],true)==0)
	        {
	            playerDB[playerid][tr] = i;
				return i;
	        }
 		}
	}
	return 1;
}
Код:
stock Check2(playerid)
{
	if(IsPlayerConnected(playerid))
	{
	    for(new i = 1; i < sizeof(CarInfo); i++)
	    {
	        new playername[MAX_PLAYER_NAME];
	        GetPlayerName(playerid,playername,sizeof(playername));
	        if(strcmp(playername,CarInfo[i][cOwner],true)==0)
	        {
 //this place is bad for me
		if(playerDB[playerid][tr]!=i)
		{
	            playerDB[playerid][tr2] = i;
	            }
				return i;
	        }
 		}
	}
	return 1;
}