How to add /givekeys /takekeys to my house script?
#1

hello does anybody knows how to add /givekeys /takekeys to my house script?? I am using Ahouse script by Antironix (1house = 1line)
Thnx !!
Reply
#2

variables.
Reply
#3

o.0 uh...more info ?
Reply
#4

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;
}
Reply
#5

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"
Reply
#6

np x-unit ;P
Reply
#7

add
pawn Код:
#pragma unused params
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)