Jump to content
  • 0

Cum fac sa nu mai dispara vehiculele dupa ce ies din ele?:|


Question

Posted

Buna,cum as putea face ca dupa ce ies din vehicul (orice vehicul) sa nu dispara ,dupa ce ies din ea

Eu spamez o masina , dupa ce ies in ia ramane vreo 40 de sec(daca nu sunt in ea) si  apoi dispare

Vreau ca masiniile spamate sa nu mai dispara DELOC doar dupa un restart la server

ce cod sa pun.....???sau ce sa fac

thx ;):X

qdbjz10.png

7 answers to this question

Recommended Posts

Posted

cauta comanda de spawnare a masinii si posteaz-o aici sau cauta prin comanda CreateVehicle sau AddStaticVehicleEx:

CreateVehicle(car, X, Y, Z, angle, colour1, colour2, RESPAWN_DELAY);
sau asa cv si inlocuieste cu
CreateVehicle(car, X, Y, Z, angle, colour1, colour2);

dar mai bn posteaza comanda ;)

Posted

sau poti sa ex: fara spawn car ...

1.sa iti salvezi o masina orice masina vrei u ii dai /save in locul unde vrei tu

2. te duci in "GTA San andreas" --> si in savedpositions.txt sau cum e la tne asa si ultima facuta e a ta masina :P

3.apoi te duci cu pawno in GM si pe la  " public OnGameModeInit() " undeva jos pe la masini adaugi  masina ta ... "AddStaticVehicle(535,2039.1257,1545.0879,10.3481,359.6690,123,1); " am dat ex:) 

4.si dupa ce bagi astea in GM dai f5 ;)

ll364l6j8dg3et84ks3w.png

Posted

stuntman==--" post="30899" timestamp="1274029049"]

cauta comanda de spawnare a masinii si posteaz-o aici sau cauta prin comanda CreateVehicle sau AddStaticVehicleEx:

CreateVehicle(car, X, Y, Z, angle, colour1, colour2, RESPAWN_DELAY);
sau asa cv si inlocuieste cu
CreateVehicle(car, X, Y, Z, angle, colour1, colour2);
dar mai bn posteaza comanda ;)
uite:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new cmd[200], idx;
	cmd = strtok(cmdtext, idx);

	if(strcmp(cmd, "/vh", true, 10) == 0)
	{

		new String[200];
		new tmp[256];
		new Float:x, Float:y, Float:z;

		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, l_red, "You diden't give a vehicle name");

		new vehicle = GetVehicleModelIDFromName(tmp);

		if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, l_red, "That vehicle name was not found");

		new Float:a;
		GetPlayerFacingAngle(playerid, a);
		GetPlayerPos(playerid, x, y, z);

		if(IsPlayerInAnyVehicle(playerid) == 1)
		{
			GetXYInFrontOfPlayer(playerid, x, y, 8);
		}
		else
		{
			GetXYInFrontOfPlayer(playerid, x, y, 5);
		}

		new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
		LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));

		format(String, sizeof(String), "You have spawned a %s", aVehicleNames[vehicle - 400]);
		SendClientMessage(playerid, l_green, String);
		return 1;
	}
	return 0;
}

strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}

	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}

GetVehicleModelIDFromName(vname[])
{
	for(new i = 0; i < 211; i++)
	{
		if(strfind(aVehicleNames[i], vname, true) != -1)
		return i + 400;
	}
	return -1;
}

stock GetXYInFrontOfPlayer(playerid, &Float:x2, &Float:y2, Float:distance)
{
	new Float:a;

	GetPlayerPos(playerid, x2, y2, a);
	GetPlayerFacingAngle(playerid, a);

	if(GetPlayerVehicleID(playerid))
	{
		GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
	}

	x2 += (distance * floatsin(-a, degrees));
	y2 += (distance * floatcos(-a, degrees));

qdbjz10.png

Posted

inlocuieste comanda

if(strcmp(cmd, "/vh", true, 10) == 0)
	{

		new String[200];
		new tmp[256];
		new Float:x, Float:y, Float:z;

		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, l_red, "You diden't give a vehicle name");

		new vehicle = GetVehicleModelIDFromName(tmp);

		if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, l_red, "That vehicle name was not found");

		new Float:a;
		GetPlayerFacingAngle(playerid, a);
		GetPlayerPos(playerid, x, y, z);

		if(IsPlayerInAnyVehicle(playerid) == 1)
		{
			GetXYInFrontOfPlayer(playerid, x, y, 8);
		}
		else
		{
			GetXYInFrontOfPlayer(playerid, x, y, 5);
		}

		new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
		LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));

		format(String, sizeof(String), "You have spawned a %s", aVehicleNames[vehicle - 400]);
		SendClientMessage(playerid, l_green, String);
		return 1;
	}
cu
if(strcmp(cmd, "/vh", true, 10) == 0)
	{

		new String[200];
		new tmp[256];
		new Float:x, Float:y, Float:z;

		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, l_red, "You diden't give a vehicle name");

		new vehicle = GetVehicleModelIDFromName(tmp);

		if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, l_red, "That vehicle name was not found");

		new Float:a;
		GetPlayerFacingAngle(playerid, a);
		GetPlayerPos(playerid, x, y, z);

		if(IsPlayerInAnyVehicle(playerid) == 1)
		{
			GetXYInFrontOfPlayer(playerid, x, y, 8);
		}
		else
		{
			GetXYInFrontOfPlayer(playerid, x, y, 5);
		}

		new PlayersVehicle = AddStaticVehicle(vehicle, x, y, z, a+90, -1, -1);
		LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));

		format(String, sizeof(String), "You have spawned a %s", aVehicleNames[vehicle - 400]);
		SendClientMessage(playerid, l_green, String);
		return 1;
	}

Posted

Da ms mult stuntman daca pun asa nu mai dispare deloc?decat dupa restart la sv?si aia cu save este exclusa din prima vreau ca playeri  sa scrie vh si sa ramana acel vehicul pana la restart la sv dpa rr la sv acele masini spamate cu vh sa dispra  cat e sv deskis sa ramana intacte ms stunt man akuma incerc

qdbjz10.png

Posted

1 warning care probabil va afecta  ;D

E:\Locker\sa-mp scripting\Tutos StuntDM!!!\Tutos StuntDM\filterscripts\spawner.pwn(231) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
Si liniile :
 [b]if(strcmp(cmd, "/vh", true, 10) == 0)[/b]
	{

		new String[200];
		new tmp[256];
		new Float:x, Float:y, Float:z;

		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, l_red, "You diden't give a vehicle name");

		new vehicle = GetVehicleModelIDFromName(tmp);

		if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, l_red, "That vehicle name was not found");

		new Float:a;
		GetPlayerFacingAngle(playerid, a);
		GetPlayerPos(playerid, x, y, z);

		if(IsPlayerInAnyVehicle(playerid) == 1)
		{
			GetXYInFrontOfPlayer(playerid, x, y, 8);
		}
		else
		{
			GetXYInFrontOfPlayer(playerid, x, y, 5);
		}

		new PlayersVehicle = AddStaticVehicle(vehicle, x, y, z, a+90, -1, -1);
		LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));

		format(String, sizeof(String), "You have spawned a %s", aVehicleNames[vehicle - 400]);
		SendClientMessage(playerid, l_green, String);
		return 1;
	}
return  1;
}



strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{

qdbjz10.png

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.