Scores for vehicles
#1

Hello there...
I Need to make a vehicle in which i'll need scores to sit in. I've placed hunters at different places by using MTA. Now I want that I'll need 800 scores to sit in the hunter... How can I make it help please?? tell me this with simple method....
Thank you in advance
Reply
#2

https://sampwiki.blast.hk/wiki/GetPlayerScore

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    if(
GetVehicleModel(vehicleid) == HUNTER_ID//Change this to the hunters vehicle id
    
{
        if(
GetPlayerScore(playerid) != 5//If the players score isn't equal to 5 it'll kil them out 
        
{
            
RemovePlayerFromVehicle(playerid); //Kicking them out
            //Add more messages here if you want
        
}
    }
    return 
1;

Theres several ways of doing it, that's just one simple example
Reply
#3

https://sampwiki.blast.hk/wiki/OnPlayerEnterVehicle
https://sampwiki.blast.hk/wiki/GetVehicleModel

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (GetVehicleModel(vehicleid) == 425 && GetPlayerScore(playerid) < 800)
    {
        ClearAnimations(playerid);
    }
    return 1;
}
EDIT: @Flake. You shouldn't use !=, because then it will only work if the player has exactly that amount of score.
Reply
#4

Thank you so much!!!! but @Stinged where can I put sendclientmessage like You need 800 scores to use this vehicle or any other msg..
Reply
#5

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (GetVehicleModel(vehicleid) == 425 && GetPlayerScore(playerid) < 800)
    {
        ClearAnimations(playerid);
        SendClientMessage(playerid, -1, "You need 800 score to fly this aircraft");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)