Not exploding.
#1

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 ;(
Reply
#2

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

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

if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 476)
Reply
#4

Fixed

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


Forum Jump:


Users browsing this thread: 1 Guest(s)