#1

new Menu:jobs;




after OnGameModeInit or OnFilterScriptInit

darbai = CreateMenu("jobs", 2, 200.0, 100.0, 150.0, 150.0);
AddMenuItem(darbai,0,"-~w~~h~Policeman");
AddMenuItem(darbai,0,"-~w~~h~S.W.A.T");
AddMenuItem(darbai,0,"-~w~~h~Medical");
AddMenuItem(darbai,0,"-~w~~h~Taxi");
AddMenuItem(darbai,0,"-~w~~h~FBI");
AddMenuItem(darbai,0,"-~r~~h~Leave");




If u wanna to add more jobs just write:
AddMenuItem(darbai,0,"-~w~~h~Name");




Ok go to cmd creating
If u wanna see jobs writed /jobs
Add this line

ShowMenuForPlayer(darbai, playerid);




Ok thats looks like this

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/jobs", cmdtext, true, 10) == 0)
{
ShowMenuForPlayer(jobs, playerid);
return 1;
}




Now create whtat if click someone job from menu
So put this down GameMode or FilterScript

public OnPlayerSelectedMenuRow(playerid, row)
{

new Menu:current;
current = GetPlayerMenu(playerid);
if(current == darbai)
{
switch(row)
{
case 0:
{
SendClientMessage(playerid,COLOR_ORANGE, "Congratulations now you are Policeman");
SetPlayerPos(playerid,-1630.6406,687.4634,7.1875);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 3, 1);
GivePlayerWeapon(playerid, 24, 1000);
GivePlayerWeapon(playerid, 29, 1000);
SendClientMessage(playerid, COLOR_GREEN, "Your job: watch the city");
SetPlayerColor(playerid, COLOR_BLUE);
SetPlayerSkin(playerid, 280);
new vardas[128], stringas[128];
GetPlayerName(playerid, vardas, sizeof(vardas));
format(stringas, sizeof(stringas), "%s Started Policeman job", vardas);
SendClientMessageToAll(COLOR_GREEN, stringas);
}
case 2:{
HideMenuForPlayer(jobs, playerid);
}
}
}
return 1;
}

And do that for other jobs...


Sorry for my bad english.
Reply
#2

Next time use a :
Код:
Code Box
/Artix
Reply
#3

okay
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)