Need help with houses scripting
#1

I need help with houses scripting. It's not supposed to be a RP house system (/sell,/buy,/rent, etc), I just need to script a house that is, for example, only open for a certain player, and I need to script cars that can be only used by a certain player, too.
I know how to make the pickup thingy, and the teleport to an interior thingy, I just really need to know how to lock houses and cars for certain players.
P.S. I started this topic because everything I can find on the forums are RP House systems.
Reply
#2

To lock the vehicle:
pawn Код:
SetVehicleParamsForPlayer(vehicleid, playerid, objective, doorslocked)
vehicleid - ID of the car.
playerid - ID of the player.
objective - Show the vehicle as a marker for the player true/false.
doorslocked - Doors locked true/false.

You can compare strings with strcmp. Example:
pawn Код:
// This would go under the /enterhouse(or whatever it is) command.

new name[MAX_PLAYER_NAME]; // Creating the name string.

GetPlayerName(playerid, name, sizeof(name)); // Getting the name of the player and inserting it to the name string.

if(!strcmp("APpLepIe", name, false)) // Comparing the name string (player's name) with "APpLepIe"
{
    //The player's name is "APpLepIe".
    SetPlayerPos();
    SetInt etc.
}
else return 1; // The player's name wasn't "APpLepIe", so return 1.
strcmp() in the wiki
Reply
#3

He doesn't talk about locking a vehicle..
Reply
#4

Quote:
Originally Posted by MenaceX^
He doesn't talk about locking a vehicle..
he does:

Quote:
Originally Posted by Wheels
I need help with houses scripting. It's not supposed to be a RP house system (/sell,/buy,/rent, etc), I just need to script a house that is, for example, only open for a certain player, and I need to script cars that can be only used by a certain player, too.
I know how to make the pickup thingy, and the teleport to an interior thingy, I just really need to know how to lock houses and cars for certain players.
P.S. I started this topic because everything I can find on the forums are RP House systems.
and search for the godfather or PENLS you'll find a RP script with the house system take a look at that and maybe you'll find the answer else ask here
Reply
#5

Use pickups, and strcmp, like already suggested.
Reply
#6

Well, thanks everyone, I tried to work with those things you said and it works just fine
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)