How to make Command here? +1Rep
#1

Hello,
I have this Script:

Код HTML:
if(pickupid == School)
	{
		if(GetPlayerTeam(playerid) == TEAM_AMERICA)
		{
	        ShowPlayerDialog(playerid,ACADEMY,DIALOG_STYLE_LIST ,"American Army Academy™","Sniper-"COL_BLUE"20XP\n"COL_RWHITE"Medic-"COL_BLUE"50XP\n"COL_RWHITE"Assault-"COL_BLUE"65XP\n"COL_RWHITE"Assassin-"COL_BLUE"90XP\n"COL_RWHITE"Suicider-"COL_BLUE"100XP\n"COL_RWHITE"Bomber-"COL_BLUE"300XP\n"COL_RWHITE"Engineer-"COL_BLUE"500XP\n"COL_RWHITE"Spy-"COL_BLUE"900XP\n"COL_RWHITE"Advanced Soldier-"COL_BLUE"950XP\n"COL_RWHITE"Pilot-"COL_BLUE"1000XP\n"COL_RED"Next>>","Learn","Leave");
		}
	}
How to make it so, that if player makes a command, then this dialog opens and not pickup?

Reward: +1rep
Thanks
Reply
#2

Hello again Charalambos26,

It is very simply, if you are using a command processor/plugin you can use the following (example is for ZCMD):
Код:
CMD:academy(playerid, params[])
{
if(GetPlayerTeam(playerid) == TEAM_AMERICA)
		{
	        ShowPlayerDialog(playerid,ACADEMY,DIALOG_STYLE_LIST ,"American Army Academy™","Sniper"COL_BLUE"20XP\n"COL_RWHITE"Medic-"COL_BLUE"50XP\n"COL_RWHITE"Assault"COL_BLUE"65XP\n"COL_RWHITE"Assassin-"COL_BLUE"90XP\n"COL_RWHITE"Suicider-"COL_BLUE"100XP\n"COL_RWHITE"Bomber-"COL_BLUE"300XP\n"COL_RWHITE"Engineer-"COL_BLUE"500XP\n"COL_RWHITE"Spy-"COL_BLUE"900XP\n"COL_RWHITE"Advanced Soldier-"COL_BLUE"950XP\n"COL_RWHITE"Pilot-"COL_BLUE"1000XP\n"COL_RED"Next>>","Learn","Leave");
		}
return 1;
}
Place this almost anywhere, normally around your other commands.

If you are not using a command processor/plugin:
Код:
if(!strcmp(cmdtext, "/academy")) 
     {
        if(GetPlayerTeam(playerid) == TEAM_AMERICA)
		{
	        ShowPlayerDialog(playerid,ACADEMY,DIALOG_STYLE_LIST ,"American Army Academy™","Sniper-"COL_BLUE"20XP\n"COL_RWHITE"Medic-"COL_BLUE"50XP\n"COL_RWHITE"Assault-"COL_BLUE"65XP\n"COL_RWHITE"Assassin-"COL_BLUE"90XP\n"COL_RWHITE"Suicider-"COL_BLUE"100XP\n"COL_RWHITE"Bomber-"COL_BLUE"300XP\n"COL_RWHITE"Engineer-"COL_BLUE"500XP\n"COL_RWHITE"Spy-"COL_BLUE"900XP\n"COL_RWHITE"Advanced Soldier-"COL_BLUE"950XP\n"COL_RWHITE"Pilot-"COL_BLUE"1000XP\n"COL_RED"Next>>","Learn","Leave");
		}
return 1;
}
Place this code under OnPlayerCommandText.

This code will make the dialog show when the player types /academy without the player being on/near the pickup.
Reply
#3

Quote:
Originally Posted by MEW273
Посмотреть сообщение
Hello again Charalambos26,

It is very simply, if you are using a command processor/plugin you can use the following (example is for ZCMD):
Код:
CMD:academy(playerid, params[])
{
if(GetPlayerTeam(playerid) == TEAM_AMERICA)
		{
	        ShowPlayerDialog(playerid,ACADEMY,DIALOG_STYLE_LIST ,"American Army Academy™","Sniper"COL_BLUE"20XP\n"COL_RWHITE"Medic-"COL_BLUE"50XP\n"COL_RWHITE"Assault"COL_BLUE"65XP\n"COL_RWHITE"Assassin-"COL_BLUE"90XP\n"COL_RWHITE"Suicider-"COL_BLUE"100XP\n"COL_RWHITE"Bomber-"COL_BLUE"300XP\n"COL_RWHITE"Engineer-"COL_BLUE"500XP\n"COL_RWHITE"Spy-"COL_BLUE"900XP\n"COL_RWHITE"Advanced Soldier-"COL_BLUE"950XP\n"COL_RWHITE"Pilot-"COL_BLUE"1000XP\n"COL_RED"Next>>","Learn","Leave");
		}
return 1;
}
Place this almost anywhere, normally around your other commands.

If you are not using a command processor/plugin:
Код:
if(!strcmp(cmdtext, "/academy")) 
     {
        if(GetPlayerTeam(playerid) == TEAM_AMERICA)
		{
	        ShowPlayerDialog(playerid,ACADEMY,DIALOG_STYLE_LIST ,"American Army Academy™","Sniper-"COL_BLUE"20XP\n"COL_RWHITE"Medic-"COL_BLUE"50XP\n"COL_RWHITE"Assault-"COL_BLUE"65XP\n"COL_RWHITE"Assassin-"COL_BLUE"90XP\n"COL_RWHITE"Suicider-"COL_BLUE"100XP\n"COL_RWHITE"Bomber-"COL_BLUE"300XP\n"COL_RWHITE"Engineer-"COL_BLUE"500XP\n"COL_RWHITE"Spy-"COL_BLUE"900XP\n"COL_RWHITE"Advanced Soldier-"COL_BLUE"950XP\n"COL_RWHITE"Pilot-"COL_BLUE"1000XP\n"COL_RED"Next>>","Learn","Leave");
		}
return 1;
}
Place this code under OnPlayerCommandText.

This code will make the dialog show when the player types /academy without the player being on/near the pickup.
Hey! Thanks first, it works,
my next problem is that my Pickups don't appear,
AFschool = CreatePickup(1210, 2, -1724.6344,881.6682,24.8906, -1);//I

dk where the problem is :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)