[DCallbacks] New callbacks for your scripts!
#1

Lots of guys asked for new callbacks. Most time the normal OnPlayerEnterCheckpoint & OnPlayerLeaveCheckpoint is enough, but when it comes to big and difficult scripts, its better to have OnPlayerEnterArea and such stuff.

DCallbacks:
o Download (Version 1.1)

Features
o OnPlayerEnterArea(playerid,areaid)
o OnPlayerLeaveArea(playerid,areaid)

Who should download and use this?
Everyone who is to lazy to read and understand the HowTo, I made . You should have skills in coding pawn/c, since it only exports the functions - no command handling in - thats what you have to do!

How can I make this work?
Open your gamemode-pawnfile.
After #include <a_samp> add #include <dcallbacks>
After public OnGameModeInit() { add SetTimer("TIMER_DCallbacks",1000,true);

For a simple example, this is an implementation which shows a little "Welcome to the course" text as soon as somebody enters the golf course in LV, and a "Bye" if the person leaves the area.

After SetTimer("TIMER_DCallbacks",1000,true); add AREA_golfcourse=AddAreaCheck(1145.0272,1412.8173,2 728.7505,2851.1440);
Before public OnGameModeInit() { add new AREA_golfcourse; // Our golfcourse area

At the end of your gamemode-pawnfile this:
pawn Code:
OnPlayerEnterArea(playerid,areaid) {
  if (areaid==AREA_golfcourse) SendClientMessage(playerid, 0xFF7B7BAA, "Welcome to the course");
 printf("OnPlayerEnterArea(%d,%d)",playerid,areaid);
}

OnPlayerLeaveArea(playerid,areaid) {
  if (areaid==AREA_golfcourse) SendClientMessage(playerid, 0xFF7B7BAA, "Bye.");
 printf("OnPlayerLeaveArea(%d,%d)",playerid,areaid);
}
More Callbacks will come soon.

Thats just a small insight, hope it will be useful.

Regards,
Jan (DracoBlue)

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)