SA-MP Forums Archive
Vehicle Spawn Command [BUG] - 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)
+--- Thread: Vehicle Spawn Command [BUG] (/showthread.php?tid=452736)



REMOVED - Campionull - 22.07.2013

REMOVED


Re: Vehicle Spawn Command [BUG] - Roko_foko - 22.07.2013

Код:
if (strcmp("/vehicle", cmd, true, 10) == 0 || strcmp("/v", cmd, true, 10) == 0)
	{
	        new carfound, Float:X, Float:Y, Float:Z, Float:A, vid;
		tmp = strtok(cmdtext, index);
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /vehicle <VehicleName>");
		for(new i; i<212; i++)
		{
		    if (strfind(VehicleNames[i], tmp, true ) != -1)
		    {
		        carfound = 1;
			GetPlayerPos(playerid, X, Y, Z);
			GetPlayerFacingAngle(playerid, A);
			vid = CreateVehicle(i+400, X, Y, Z, A, -1, -1, 600000);
			PutPlayerInVehicle(playerid, vid, 0);
                        new string[128];
		        format(string, sizeof(string), "* You spawned a new %s...", VehicleNames[i]);
		        SendClientMessage(playerid, COLOR_YELLOW, string);
                ------->break;// COMMMMMMMMENT
			}
		}
		if(carfound == 0)
		{
		    new str[128];
		    format(str, sizeof(str), "* Sorry, no results were found for the vehicle name: \"%s\"", tmp);
		    SendClientMessage(playerid, COLOR_YELLOW, str);
		}
		return 1;
	}
COMMMMMMENT: If you add this line it will spawn only one vehicle ( the first vehicle that it finds )
Hope I helped :P


Re: Vehicle Spawn Command [BUG] - Campionull - 22.07.2013

Thanks