Vehicle Ownership
#1

I'm creating a vehicle ownership from scratch for my RP script, but I'm stuck. How am I supposed to spawn a "unique" vehicle, which is housecar and will allow the player to lock that car specifically if they own it?

Basically, I would like to know how to make a "IsInHouseCar" function, but I'm not sure how.
Reply
#2

Not sure how to do it for people who own it but here is some /lock and /unlock command.
pawn Код:
OnGameModeInit()
{
       CreateVehicle(blah, blah, blah, blah, blah, blah);
}

public OnPlayerCommandText (playerid, cmdtext[])
{
     if (strmp("/unlock", cmdtext, true, 10) == 0)
     {
     Unlockmycars(playerid);
     return 1;
     }
     if (strmp("/lock", cmdtext, true, 10) == 0)
     {
     Lockmycars(playerid);
     return 1;    
     }
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
SetVehicleParamsForPlayer(1, forplayerid 0, 1);
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
SetVehicleParamsForPlayer(1, forplayerid 0, 1);
}

Lockmycars(playerid)
{
SetVehicleParamsForPlayer(1, forplayerid 0, 1);
}

Unlockmycars(playerid)
{
SetVehicleParamsForPlayer(1, forplayerid 0, 0);
}
You might need to forward Unlockmycars and Lockmycars if there's an error
Reply
#3

Well I understand how to lock cars, I just don't know how to tell if they are in their housecar or not.
Reply
#4

Well I would make areas and use

IsPlayerInArea and work from there..

But of course I may be wrong because I have never scripted or dealt with anything like this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)