[Include] Church System [Create church system/mission in one line]
#1

Church System
[Create church system/mission in one line]


Introduction

I get this idea from Anak's Church System.

You can create church in one line.
There is 4 callbacks to check if player enter/exit on church checkpoint.
There is 2 callbacks to check if player enter/exit on church vehicle.
There is 2 callbacks to check if player enter mission/enter a mission (double mission)

4 function related all about church (If Church Exist/Vehicles/Entrance/Exit Points)
5 function related all about church mission (Setting/Starting/Stopping/Next)

You can either create church if it is enterable. If it is enterable. You can teleport him in a interior or in a place (although you can still do this when enterable is set to 0)

If it is 0. You can only show it for menus. OnPlayerExitChurchMenu gets called when leave the checkpoint, still can be used for teleporting.

Callback

OnPlayerEnterChurchMenu(playerid, churchid)
parameters: playerid, churchid

• Gets called when player enter the church cp (Only gets called if the church is created with enterable set to 0)

OnPlayerExitChurchMenu(playerid, churchid)
parameters: playerid, churchid

• Gets called when player leave the church cp (Only gets called if the church is created with enterable set to 0)

OnPlayerEnterChurch(playerid, churchid)
parameters: playerid, churchid

• Gets called when player enter the church cp (Only gets called if the church is created with enterable set to 1)

OnPlayerEnterCEPoint(playerid, churchid)
parameters: playerid, churchid

• Gets called when player leave the church cp (Only gets called if the church is created with enterable set to 1)
Note: The churchid isn't base on CreateChurch. It is base on SetChurchExit's churchid.

OnPlayerEnterChurchVehicle(playerid, vehicleid, ispassenger)
parameters: Same with OnPlayerEnterVehicle

• Gets called when player enter the church vehicle

OnPlayerExitChurchVehicle(playerid, vehicleid)
parameters: playerid, vehicleid

• Gets called when player exit the church vehicle

OnPlayerEnterChurchMission(playerid)
parameters: playerid

• Gets called if the church mission is about 1 delivering only.

OnPlayerEnterChurchMissionEx(playerid)
parameters: playerid

• Gets called if the church mission is more than 1 delivering mission (NextChurchMission)

Function

CreateChurch(enterable = 0, interior = -1, world = -1, Float:cpsize = 2.0, Float:churchx, Float:churchy, Float:churchz, Float:churchdistance = 100.0)

• enterable = if it is 0. OnPlayerEnter/ExitChurchMenu gets called. If it is 1. OnPlayerEnterChurch gets called instead.
• interior = where interior can the church can be seen
• world = where virtual world can the church can be seen.
• cpsize = the checkpoint size for the church.
• churchx, y, z = x, y, z coordinates
• churchdistance = if player is not in the range of churchdistance the checkpoint disappears.

SetChurchExit(&id, interior = -1, world = -1, Float:cpsize = 2.0, Float:churchx, Float:churchy, Float:churchz, Float:churchdistance = 100.0)

• Same with CreateChurch but with id parameter
• id - stores the exit point id.

SpawnChurchVehicle(vehicleid, Floatpawnx, Floatpawny, Floatpawnz, Floatpawnangle, color1, color2, spawndelay)

• Like AddStaticVehicleEx. But when entered/exit on it. OnPlayerEnter/ExitChurchVehicle is called.

StartChurchMission(playerid, Float:mx, Float:my, Float:mz, Float:cpsize = 5.0)

• Like SetPlayerCheckpoint. Difference. Calls the callback OnPlayerEnterChurchMission

NextChurchMission(playerid, Float:mx, Float:my, Float:mz, Float:cpsize = 5.0)

• Like StartChurchMission. Difference. It can create more delivering mission more than 1. Calls the callback OnPlayerEnterChurchMissionEx.

SetChurchMission(playerid, mission)

• If setted to -1. It stops the mission and disables the checkpoint.

GetChurchMission(playerid)

• Gets the current church mission, returns integer not a string!

IsValidChurch(churchid)

• Checks if the church is created or not. if checking if it doesn't exist use (!) (without paranthesis)

Notices

- You need latest version of streamer to make this work
- use the church.pwn from the .rar file to see how to use it.
- OnPlayerEnterMission cannot use GetChurchMission(playerid) >= 1 since it only gets called for 1 delivering mission only.

- OnPlayerEnterMissionEx needs GetChurchMission to make it function properly since it has no missionid parameter on the callback.

Like

pawn Код:
if(GetChurchMission(playerid) == 1) //The nextchurchmission from OnPlayerEnterMission
{
//code - nextchurchmission if needed
}
else if(GetChurchMission(playerid) == 2)
{
//mission ended - code
}
Screenshot





Downloadlink

Pastebin
Solidfiles
Reply
#2

nice scripts but you are jking
right? Or i would make a include on pd drug house etc -_- well still nice idea altought it wasnt yours
Reply
#3

Great job , but wasnt that more like a FS or something ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)