How to Create Actor Job JOIN/QUIT ? -
sonn51280 - 08.09.2018
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)
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
Re: How to Create Actor Job JOIN/QUIT ? -
sonn51280 - 08.09.2018
yeah........
Re: How to Create Actor Job JOIN/QUIT ? -
Dayrion - 08.09.2018
[
Tutorial] How to Copy & Paste a code
Re: How to Create Actor Job JOIN/QUIT ? -
sonn51280 - 08.09.2018
Quote:
Originally Posted by Dayrion
[Tutorial] How to Copy & Paste a code
|
I do not understand what you mean
Re: How to Create Actor Job JOIN/QUIT ? -
KinderClans - 11.09.2018
Quote:
Originally Posted by sonn51280
I do not understand what you mean
|
That's what i said when reading your topic.
Re: How to Create Actor Job JOIN/QUIT ? -
RogueDrifter - 11.09.2018
Hahaha look its another shitty 'tutorial'
Re: How to Create Actor Job JOIN/QUIT ? -
sonn51280 - 12.09.2018
What xDDDDDD
I'm newbie script in vietnam
Re: How to Create Actor Job JOIN/QUIT ? -
CodeStyle175 - 12.09.2018
so do you need tutorial for yourself about coding?