[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
#2

yeah........
Reply
#3

[Tutorial] How to Copy & Paste a code
Reply
#4

Quote:
Originally Posted by Dayrion
View Post
[Tutorial] How to Copy & Paste a code
I do not understand what you mean
Reply
#5

Quote:
Originally Posted by sonn51280
View Post
I do not understand what you mean
That's what i said when reading your topic.
Reply
#6

Hahaha look its another shitty 'tutorial'
Reply
#7

What xDDDDDD

I'm newbie script in vietnam
Reply
#8

so do you need tutorial for yourself about coding?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)