SA-MP Forums Archive
Question! - 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: Question! (/showthread.php?tid=184547)



Bit of help! - ColdXX - 20.10.2010

Is there any way of making this a bit smaller?
Код:
if(strcmp(cmdtext,"/derby",true)==0)
		{
        switch(derby)
		{
		case 0:
		{
		SetPlayerPos(playerid, 2447.5903,-1661.4089,12.8769);
		derby++;
	    new vehicle;		vehicle = GetPlayerVehicleID(playerid);		DestroyVehicle(vehicle);
		new Float:Pos[3]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
	  	new veh = CreateVehicle(522, 2447.5903,-1661.4089,12.8769,91.1508, -1, -1,10000);
        SetVehicleVirtualWorld(veh, 3);//GetPlayerVehicleID(playerid)
  		PutPlayerInVehicle(playerid, veh, 0);
        TogglePlayerControllable(playerid,0);
		}
		case 1:
		{
		SetPlayerPos(playerid, 2447.6062,-1656.1062,12.8695);
		derby++;
        new vehicle;		vehicle = GetPlayerVehicleID(playerid);		DestroyVehicle(vehicle);
		new Float:Pos[3]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
	  	new veh = CreateVehicle(522, 2447.6062,-1656.1062,12.8695,90.0000, -1, -1,10000);
        SetVehicleVirtualWorld(veh, 3);//GetPlayerVehicleID(playerid)
  		PutPlayerInVehicle(playerid, veh, 0);
		TogglePlayerControllable(playerid,0);
		}
I wanna use 20 cars instead of 2 and using case it will make a long script!
And when it reaches the 20th case i cant teleport to the derby anymore...lol

Help