31.07.2011, 15:21
(
Последний раз редактировалось [LoD]Hauke; 01.08.2011 в 00:29.
Причина: 1.1 update
)
Good afternoon,
iґve made a fast method to create enterable interiors with use of pickups.
Its a filterscript with an include for gamemodes an other filterscripts.
Included functions:
On first look, may it's incredible confused, but it isnґt! Itґs much simplier than creating pickup for pickup.
Function description:
AddInterior ( ... )
iM: . . . . . . . . Message to show for player while entering interior. Itґs a textdraw.
iVW: . . . . . . . VirtualWorld of Interior. So youґre able to use interiors more than one time
iI: . . . . . . . . . InteriorID of interior.
iX: . . . . . . . . . X position of entrance-pickup. And itґs the exit X coordinate.
iY: . . . . . . . . . Y position of entrance-pickup. And itґs the exit Y coordinate.
iZ: . . . . . . . . . Zposition of entrance-pickup. And itґs the exit Z coordinate.
iA: . . . . . . . . . FacingAngle for player at exit point
iPT: . . . . . . . . .The pickuptype of enter pickup. Normally itґs set to NULL, but you can change if you want.
iPM: . . . . . . . . .The pickupmodel from enter pickup. Normally its set to NULL, but you can change if you want.
iG: . . . . . . . . . .The gametextstyle from entrance. Normally its set to NULL, but you can change if you want.
iAK: . . . . . . . . .If you want players to use the ENTER key to enter interior too, set to YES, else set to NO.
oM: . . . . . . . . .Message to show for player while leaving interior. Itґs a textdraw too.
oVW: . . . . . . . .The virtualworld of exit position. Normally 0, but youґre able to change.
oI: . . . . . . . . . .InteriorID of exit position.
oX: . . . . . . . . . X position of exit-pickup. And itґs the entrace X coordinate.
oY: . . . . . . . . . Y position of exit-pickup. And itґs the entrace Y coordinate.
oZ: . . . . . . . . . Z position of exit-pickup. And itґs the entrace Z coordinate.
oA: . . . . . . . . . FacingAngle at entering interior.
oPT: . . . . . . . . .The pickuptype of exit pickup. Normally itґs set to NULL, but you can change if you want.
oPM: . . . . . . . . .The pickupmodel from exit pickup. Normally its set to NULL, but you can change if you want.
oG: . . . . . . . . . The gametextstyle from exit. Normally its set to NULL, but you can change if you want.
oAK: . . . . . . . . .If you want players to use the ENTER key to leave interior too, set to YES, else set to NO.
This function returs the id of new interior. If interior could not created it returns -1.
RemoveInterior ( ... )
interior: . . . . . . . . . Id of interior that should be deleted.
Returns true if interior was deleted, and false if interior does not exist.
Included callbacks:
Callback description:
OnPlayerEnterInterior
Will be called if the player tries to get into an interior. method is the way of it ( METHOD_KEY = by pressing enter & METHOD_PICKUP = by picking up pickup)
OnPlayerLeaveInterior
Will be called if the player tries to get out of an interior. method is the way of it ( METHOD_KEY = by pressing enter & METHOD_PICKUP = by picking up pickup)
OnPlayerEnteredInterior
Will be called if the player got into an interior. method is the way of it ( METHOD_KEY = by pressing enter & METHOD_PICKUP = by picking up pickup)
OnPlayerLeavedInterior
Will be called if the player out of an interior. method is the way of it ( METHOD_KEY = by pressing enter & METHOD_PICKUP = by picking up pickup)
Exaple code:
Here you will se how easy it is to use!
Optional - AddInteriors generator:
Iґve coded a very simple generator for the AddInterior function. With it you can generate ingame you command with all parameters. It is stored in an .adi file in /scriptfiles
Commands are (you must be logged in as rcon admin!):
Here is a video of it:
[ame]http://www.youtube.com/watch?v=ShcRGbwk20c&feature=channel_video_title[/ame]
Update to 1.1:
Now there are 4 new callbacks, that can be used to easy create an own house system!
Until now you must copy these lines into your code:
It would be very nice, if someone can make a tutorial how to make a house system with this.
Download:
Ohne AddInterior generator 1.1
Ohne AddInterior generator 1.1 - Pastebin
Mit AddInterior generator 1.1
Mit AddInterior generator 1.1 - Pastebin
i hope you find use for it!
greetings from germany - Hauke
iґve made a fast method to create enterable interiors with use of pickups.
Its a filterscript with an include for gamemodes an other filterscripts.
Included functions:
pawn Код:
AddInterior ( iM[ ] , iVW , iI , Float:iX , Float:iY , Float:iZ , Float:iA , iPT , iPM , iG , iAK , oM[ ] , oVW , oI , Float:oX , Float:oY , Float:oZ , Float:oA , oPT , oPM , oG , oAK )
RemoveInterior ( interior )
Function description:
AddInterior ( ... )
iM: . . . . . . . . Message to show for player while entering interior. Itґs a textdraw.
iVW: . . . . . . . VirtualWorld of Interior. So youґre able to use interiors more than one time
iI: . . . . . . . . . InteriorID of interior.
iX: . . . . . . . . . X position of entrance-pickup. And itґs the exit X coordinate.
iY: . . . . . . . . . Y position of entrance-pickup. And itґs the exit Y coordinate.
iZ: . . . . . . . . . Zposition of entrance-pickup. And itґs the exit Z coordinate.
iA: . . . . . . . . . FacingAngle for player at exit point
iPT: . . . . . . . . .The pickuptype of enter pickup. Normally itґs set to NULL, but you can change if you want.
iPM: . . . . . . . . .The pickupmodel from enter pickup. Normally its set to NULL, but you can change if you want.
iG: . . . . . . . . . .The gametextstyle from entrance. Normally its set to NULL, but you can change if you want.
iAK: . . . . . . . . .If you want players to use the ENTER key to enter interior too, set to YES, else set to NO.
oM: . . . . . . . . .Message to show for player while leaving interior. Itґs a textdraw too.
oVW: . . . . . . . .The virtualworld of exit position. Normally 0, but youґre able to change.
oI: . . . . . . . . . .InteriorID of exit position.
oX: . . . . . . . . . X position of exit-pickup. And itґs the entrace X coordinate.
oY: . . . . . . . . . Y position of exit-pickup. And itґs the entrace Y coordinate.
oZ: . . . . . . . . . Z position of exit-pickup. And itґs the entrace Z coordinate.
oA: . . . . . . . . . FacingAngle at entering interior.
oPT: . . . . . . . . .The pickuptype of exit pickup. Normally itґs set to NULL, but you can change if you want.
oPM: . . . . . . . . .The pickupmodel from exit pickup. Normally its set to NULL, but you can change if you want.
oG: . . . . . . . . . The gametextstyle from exit. Normally its set to NULL, but you can change if you want.
oAK: . . . . . . . . .If you want players to use the ENTER key to leave interior too, set to YES, else set to NO.
This function returs the id of new interior. If interior could not created it returns -1.
RemoveInterior ( ... )
interior: . . . . . . . . . Id of interior that should be deleted.
Returns true if interior was deleted, and false if interior does not exist.
Included callbacks:
pawn Код:
OnPlayerEnterInterior ( playerid , interior , method )
OnPlayerLeaveInterior ( playerid , interior , method )
OnPlayerEnteredInterior ( playerid , interior , method )
OnPlayerLeavedInterior ( playerid , interior , method )
OnPlayerEnterInterior
Will be called if the player tries to get into an interior. method is the way of it ( METHOD_KEY = by pressing enter & METHOD_PICKUP = by picking up pickup)
OnPlayerLeaveInterior
Will be called if the player tries to get out of an interior. method is the way of it ( METHOD_KEY = by pressing enter & METHOD_PICKUP = by picking up pickup)
OnPlayerEnteredInterior
Will be called if the player got into an interior. method is the way of it ( METHOD_KEY = by pressing enter & METHOD_PICKUP = by picking up pickup)
OnPlayerLeavedInterior
Will be called if the player out of an interior. method is the way of it ( METHOD_KEY = by pressing enter & METHOD_PICKUP = by picking up pickup)
Exaple code:
Here you will se how easy it is to use!
pawn Код:
#include <a_samp>
#include <h_interiors>
new AdminHouse;
public OnGameModeInit()
{
AdminHouse = AddInterior ( "Welcome Admin!" , NULL , 0 , 1953.704956 , 1342.881958 , 15.374607 , 86.697219 , NULL , NULL , NULL , YES , "byee" , NULL , 3 , 235.407196 , 1187.490844 , 1080.257812 , 83.480270 , NULL , NULL , NULL , YES );
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if ( !strcmp ( "/remove house" , cmdtext ) )
{
RemoveInterior ( AdminHouse);
return 1;
}
if ( !strcmp ( "/addhouse",cmdtext))
{
AdminHouse = AddInterior ( "Welcome home!" , NULL , 0 , 1953.704956 , 1342.881958 , 15.374607 , 86.697219 , NULL , NULL , NULL , YES , "byee" , NULL , 3 , 235.407196 , 1187.490844 , 1080.257812 , 83.480270 , NULL , NULL , NULL , YES );
return 1;
}
return 0;
}
public OnPlayerEnterInterior(playerid ,interior ,method)
{
if ( interior == AdminHouse && !IsPlayerAdmin ( playerid )
{
SendClientMessage(playerid,0x666666AA,"This House can only accessed by admins!");
return 0;
}
return 1;
}
public OnPlayerEnteredInterior(playerid ,interior ,method)
{
new string[ 128 ] , name[ MAX_PLAYER_NAME ] , Method[ 32 ];
GetPlayerName ( playerid , name , MAX_PLAYER_NAME );
if ( method == METHOD_KEY )
format ( Method , 32 , "pressing ENTER key" );
else
format ( Method , 32 , "picking up pickup" );
format ( string , 128 , "Player: %s entered interior: %d by %s" , name , interior , Method );
SendClientMessage ( playerid , 0x666666AA , string );
return 1;
}
public OnPlayerLeaveInterior(playerid, interior, method)
{
return 1;
}
public OnPlayerLeavedInterior(playerid, interior, method)
{
new string[ 128 ] , name[ MAX_PLAYER_NAME ] , Method[ 32 ];
GetPlayerName ( playerid , name , MAX_PLAYER_NAME );
if ( method == METHOD_KEY )
format ( Method , 32 , "pressing ENTER key" );
else
format ( Method , 32 , "picking up pickup" );
format ( string , 128 , "Player: %s leaved interior: %d by %s" , name , interior , Method );
SendClientMessage ( playerid , 0x666666AA , string );
return 1;
}
Iґve coded a very simple generator for the AddInterior function. With it you can generate ingame you command with all parameters. It is stored in an .adi file in /scriptfiles
Commands are (you must be logged in as rcon admin!):
Код:
#help #new #setenter #setexit #spp
[ame]http://www.youtube.com/watch?v=ShcRGbwk20c&feature=channel_video_title[/ame]
Update to 1.1:
Now there are 4 new callbacks, that can be used to easy create an own house system!
Until now you must copy these lines into your code:
pawn Код:
public OnPlayerEnterInterior(playerid ,interior ,method)
{
return 1;
}
public OnPlayerEnteredInterior(playerid ,interior ,method)
{
return 1;
}
public OnPlayerLeaveInterior(playerid, interior, method)
{
return 1;
}
public OnPlayerLeavedInterior(playerid, interior, method)
{
return 1;
}
Download:
Ohne AddInterior generator 1.1
Ohne AddInterior generator 1.1 - Pastebin
Mit AddInterior generator 1.1
Mit AddInterior generator 1.1 - Pastebin
i hope you find use for it!
greetings from germany - Hauke