Need help with houses scripting - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help with houses scripting (
/showthread.php?tid=67661)
Need help with houses scripting -
Wheels - 03.03.2009
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.
Re: Need help with houses scripting -
Finn - 03.03.2009
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
Re: Need help with houses scripting -
MenaceX^ - 03.03.2009
He doesn't talk about locking a vehicle..
Re: Need help with houses scripting -
Think - 03.03.2009
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
Re: Need help with houses scripting -
x-cutter - 03.03.2009
Use pickups, and strcmp, like already suggested.
Re: Need help with houses scripting -
Wheels - 04.03.2009
Well, thanks everyone, I tried to work with those things you said and it works just fine