[Tutorial] How to Create Actor Job JOIN/QUIT ?
#1

Hello world and all the people watching this

! sorry my bad english
we must have #include a_actor.inc
https://github.com/NextGenerationGam.../pawno/include
----------------------------------------------------
step 1 : Create callback (new)
Code:
new ATthamtu;
step 2 : Create define
Code:
#define     JoBdetective     (1000)
step 3 : Create OnPlayerKeyState
ID Gamemodel different between type NGG / ..... ( if(PlayerInfo[playerid][pJob] != 1 && PlayerInfo[playerid][pJob2] != 1))
Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys & KEY_HANDBRAKE) && (newkeys & KEY_YES))//Tham Tu
    {
         if(IsPlayerInRangeOfActor(playerid, ATthamtu))
         {
         if(PlayerInfo[playerid][pJob] != 1 && PlayerInfo[playerid][pJob2] != 1)
		 {
		 ShowPlayerDialog(playerid, JoBdetective, DIALOG_STYLE_LIST, "Cong Viec Tham tu", "Xin viec\nNghi viec chinh\nNghi viec phu", "Dong y", "Khong");
		 }
		 else ShowPlayerDialog(playerid, JoBdetective, DIALOG_STYLE_LIST, "Cong Viec Tham tu", "Xin viec\nNghi viec chinh\nNghi viec phu", "Dong y", "Khong");
         }
   	}
	return 1;
}
step 4 : Create Dialog
Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	new sendername[MAX_PLAYER_NAME];
	new string[128];

	// Crash Bug Fix
 	if(strfind(inputtext, "%", true) != -1)
  	{
  	    SendClientMessageEx(playerid, COLOR_GREY, "Invalid Character, please try again.");
		return 1;
	}
	if(dialogid == JoBdetective)
	{
	     if(response)
	     {
	     if(listitem == 0)
             {
             return cmd_joinjob(playerid, "");
             }
             if(listitem == 1)
             {
             return cmd_quitjob(playerid, "1");
             }
             if(listitem == 2)
             {
             return cmd_quitjob(playerid, "2");
             }
        }
   }
   return 1;
}
step 5 : Create Actor forward LoadStreamerDynamicObjects();
Code:
ATthamtu = CreateActor(2, X,Y,Z );
forward LoadStreamerDynamic3DTextLabels();
step 6 : Create Text3D
Code:
CreateDynamic3DTextLabel("{00FFFF}(0) press right mouse and y to interactive",COLOR_YELLOW,X,Y,Z+0.5,6.0);
step 7 : Create stock
Code:
stock IsPlayerInRangeOfActor(playerid, actorid, Float:radius = 5.0)
{
        new Float:x,
            Float:y,
            Float:z;

        if (GetActorPos(actorid, x, y, z))
        {
            return IsPlayerInRangeOfPoint(playerid, radius, x, y, z);
        }
        return 0;
}
End, thanks all watching !
sign : Mr Son
me only a new users in forum.sa-mp.com
Reply


Messages In This Thread
How to Create Actor Job JOIN/QUIT ? - by sonn51280 - 08.09.2018, 14:16
Re: How to Create Actor Job JOIN/QUIT ? - by sonn51280 - 08.09.2018, 14:22
Re: How to Create Actor Job JOIN/QUIT ? - by Dayrion - 08.09.2018, 14:27
Re: How to Create Actor Job JOIN/QUIT ? - by sonn51280 - 08.09.2018, 14:37
Re: How to Create Actor Job JOIN/QUIT ? - by KinderClans - 11.09.2018, 00:27
Re: How to Create Actor Job JOIN/QUIT ? - by RogueDrifter - 11.09.2018, 00:42
Re: How to Create Actor Job JOIN/QUIT ? - by sonn51280 - 12.09.2018, 04:38
Re: How to Create Actor Job JOIN/QUIT ? - by CodeStyle175 - 12.09.2018, 10:27

Forum Jump:


Users browsing this thread: 1 Guest(s)