SA-MP Forums Archive
Not exploding. - 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: Not exploding. (/showthread.php?tid=433088)



Not exploding. - Strier - 25.04.2013

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_FIRE))
    {
        if(IsPlayerInVehicle(playerid, 476))
        {
            new Float:Pos[4], str[245], count = 0;
            GetPlayerPos(playerid, Pos[1], Pos[2], Pos[3]);
            CreateExplosion(Pos[1], Pos[2], Pos[3], 3, 10.0);
           
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerInRangeOfPoint(i, 10.0, Pos[1], Pos[2], Pos[3]))
                {
                    count++;
                    GameTextForPlayer(i, "~w~~h~Kamikaze attack!~n~~r~~h~You got exploded by a rustler!", 3000, 4);
                    SetPlayerHealth(i, 0);
                    SendDeathMessage(playerid, i, 53);
                    SendClientMessage(playerid, -1, "|- Kamikaze attack kills - |");
                    format(str, sizeof(str), "- %s ", count);
                    SendClientMessage(playerid, -1, str);
                    SetPlayerScore(playerid, GetPlayerScore(playerid)+i);
                }
            }
        }
    }
    return 1;
}
When i press the fire key the vehicle doesn't explode ;(


Re: Not exploding. - Vince - 25.04.2013

You need GetVehicleModel instead of IsPlayerInVehicle. There is a HUGE difference between a modelid and a vehicleid.


Re: Not exploding. - Pottus - 25.04.2013

I think Vince has the right idea like this....

if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 476)


Respuesta: Not exploding. - Strier - 25.04.2013

Fixed

Still not working, tho i have the feeling i wrongly made it.