SA-MP Forums Archive
Spikes in air - 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: Spikes in air (/showthread.php?tid=586783)



Spikes in air - Jimmi - 25.08.2015

I did ocomanda spikes and they do not appear on the road appear in the air ...

http://i.imgur.com/beo5jik.png
Код:
//========================================[CMD:SPIKESTRIPES]===================================================
CMD:spikestripes(playerid, params[])
	{
		if (!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Nu esti politist!");
		if (PlayerInfo[playerid][pSpikestrip] != 0) return SendClientMessage(playerid, COLOR_GREY, "Poti folosi doar 1 spike-strip in acelasi timp, scrie /rsp pentru a-l sterge pe cel actual.");
		if (spikestriptimer != 0) return SendClientMessage(playerid, COLOR_GREY, "Asteapta putin inainte sa mai pui un spike-strip!");
		new Float:A;
		new sendername[MAX_PLAYER_NAME], string[256];
		GetPlayerPos(playerid, X, Y, Z);
		GetPlayerFacingAngle(playerid, A);
		PlayerInfo[playerid][pSpikestrip] = CreateDynamicObject(2899, X, Y, Z, 0.0, 0.0, A+180);
		SetPlayerPos(playerid, X, Y, Z+4);
		GameTextForPlayer(playerid, "~w~SpikeStrip ~r~Pus", 5000, 5);
		SendClientMessage(playerid, COLOR_GREEN, "Ai pus un spike-strip cu succes, scrie /rsp sau /removespikestrip pentru a-l sterge.");
		spikestriptimer = 1;
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "HQ: Un spike-strip a fost depus de catre %s, si a fost marcat pe harta cu un checkpoint.", sendername);
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			{
				if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1)
				{
					SetPlayerCheckpoint(playerid, X, Y, Z-10, 1.0);
					SendClientMessage(i, TEAM_BLUE_COLOR, string);
					if (PlayerInfo[i][pRank] >= 5 && PlayerInfo[i][pMember] || PlayerInfo[i][pLeader] == 1)
					{
						SendClientMessage(i, COLOR_YELLOW, "Poti sterge toate spike-strip tastand /rspall");
					}
				}
			}
		}
		SetTimer("ResetSpikestripTimer", 60000, false);
		return 1;
	}



Re: Spikes in air - Variable™ - 25.08.2015

This
Код:
    PlayerInfo[playerid][pSpikestrip] = CreateDynamicObject(2899, X, Y, Z, 0.0, 0.0, A+180);
To

Код:
    PlayerInfo[playerid][pSpikestrip] = CreateDynamicObject(2899, X, Y, Z-5, 0.0, 0.0, A+180);



Re: Spikes in air - Abagail - 25.08.2015

5 seems to be way too high, try decreasing the values slightly(change the Z).


Re: Spikes in air - Jimmi - 25.08.2015

Wrong


Re: Spikes in air - Jimmi - 25.08.2015

http://i.imgur.com/h7kon3J.jpg
PlayerInfo[playerid][pSpikestrip] = CreateDynamicObject(2899, X, Y, Z-1, 0.0, 0.0, A+180);


but when they do besides pass surf car wheels ...


Re: Spikes in air - Variable™ - 25.08.2015

Код:
    PlayerInfo[playerid][pSpikestrip] = CreateDynamicObject(2899, X, Y, Z-0.5, 0.0, 0.0, A+180);



Re: Spikes in air - Abagail - 25.08.2015

That only makes it worse. You should try using a value such as -0.2 minus the Z such as:
pawn Код:
PlayerInfo[playerid][pSpikestrip] = CreateDynamicObject(2899, X, Y, Z-0.25, 0.0, A+180);