SA-MP Forums Archive
Don't break your wheels and. .. - 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: Don't break your wheels and. .. (/showthread.php?tid=586827)



Don't break your wheels and. .. - Jimmi - 25.08.2015

I did not break the/spikestreapes but command wheels ... It's good that you put here
https://sampforum.blast.hk/showthread.php?tid=137658 2899, x, y, z-0.9, 0, 0, Angle-90); but don't break your wheels ...

Код:
//========================================[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.9, 0.0, 0.0, A-90);
		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: Don't break your wheels and. .. - Jimmi - 25.08.2015

upppp


Re: Don't break your wheels and. .. - MarvinPWN - 25.08.2015

Can you explain us what exactly do you want? I don't know what you want to do.


Re: Don't break your wheels and. .. - Jimmi - 25.08.2015

Pass over sharp spikes but not break the wheel .... Are placed correctly in the ground ...


Re: Don't break your wheels and. .. - Abagail - 25.08.2015

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && isNearSpikestrip(playerid, 2.5))
    {
        if(!tireDamage(GetPlayerVehicleID(playerid))
        {
            UpdateVehicleDamage(GetPlayerVehicleID(playerid), encode_tires(1, 1, 1, 1);
        }
    }
   
    return 1;
}

UpdateVehicleDamage(vehicleid, tires)
{
    new panels, doors, lights, tires_old;
    GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires_old);
    UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
   
    return 1;
}
This is an example, though I don't really recommend using OnPlayerUpdate.