How to add /givekeys /takekeys to my house script? - 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: How to add /givekeys /takekeys to my house script? (
/showthread.php?tid=161615)
How to add /givekeys /takekeys to my house script? -
x-unit - 20.07.2010
hello does anybody knows how to add /givekeys /takekeys to my house script?? I am using Ahouse script by Antironix (1house = 1line)
Thnx !!
Re: How to add /givekeys /takekeys to my house script? -
Kar - 20.07.2010
variables.
Re: How to add /givekeys /takekeys to my house script? -
x-unit - 20.07.2010
o.0 uh...more info ?
Re: How to add /givekeys /takekeys to my house script? -
selten98 - 20.07.2010
pawn Код:
enum PlayerData
{
xunitHouseOwner,
xunitHouseKey
};
new PlayerInfo[MAX_PLAYERS][PlayerData];
under OnPlayerCommand....
pawn Код:
if(strcmp(cmd,"/givekeys",true) == 0)
{
if(PlayerInfo[playerid][xunitHouseOwner] == 1) {
dUserSetINT(PlayerName2(player1)).("xunitHouseKey",1);
}
return 1;
}
if(strcmp(cmd,"/takekeys",true) == 0)
{
if(PlayerInfo[playerid][xunitHouseOwner] == 1) {
dUserSetINT(PlayerName2(player1)).("xunitHouseKey",0);
}
return 1;
}
and in ur checkpoint add something like:
pawn Код:
stock OnPlayerEnterStreamedCheckpoint(playerid, CPiD)
{
printf("CPID: %d", CPiD);
if(CPiD == CPS1) // for my checkpoints
{
if(PlayerInfo[playerid][xunitHouseKey] == 1) {
SetPlayerPos(playerid,x,y,z,a);
}
}
return 1;
}
Re: How to add /givekeys /takekeys to my house script? -
x-unit - 20.07.2010
thnx i will try it now to see if it's working

thnx
EDIT: I have pickups (OnPlayerPickUpPickup) and i dont know how to change them from CP
And i got some errors:
Код:
aHouse.pwn(830) : error 017: undefined symbol "PlayerName2"
aHouse.pwn(827) : warning 203: symbol is never used: "params"
aHouse.pwn(837) : error 017: undefined symbol "PlayerName2"
aHouse.pwn(834) : warning 203: symbol is never used: "params"
Re: How to add /givekeys /takekeys to my house script? -
selten98 - 20.07.2010
np x-unit ;P
Re: How to add /givekeys /takekeys to my house script? -
selten98 - 22.07.2010
add
or del the params define.
and for PlayerName2:
pawn Код:
stock PlayerName2(playerid) {
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
just download cp streamer ;P !! instead of pickups