CMD:go(playerid)
{
if(PlayerInfo[playerid][pAdminLevel]) ShowPlayerDialog(playerid, DIALOG_GO, DIALOG_STYLE_LIST, "SERVER: Teleport Locations", "House Interiors\nRace Tracks\nCity Locations\nPopular Locations\nGym Interiors\nOther", "Select", "Cancel");
else SendClientMessage(playerid, COLOR_WHITE, "Only admins are allowed to use this command!");
return 1;
}
CMD:go(playerid)
{
if(PlayerInfo[playerid][pAdminLevel] => 1) ShowPlayerDialog(playerid, DIALOG_GO, DIALOG_STYLE_LIST, "SERVER: Teleport Locations", "House Interiors\nRace Tracks\nCity Locations\nPopular Locations\nGym Interiors\nOther", "Select", "Cancel");
else SendClientMessage(playerid, COLOR_WHITE, "Only admins are allowed to use this command!");
return 1;
}
|
You need to use control structures properly, please read this:
https://sampwiki.blast.hk/wiki/Control_Structures#if If you want it for all admin levels, try: Код:
CMD:go(playerid)
{
if(PlayerInfo[playerid][pAdminLevel] => 1) ShowPlayerDialog(playerid, DIALOG_GO, DIALOG_STYLE_LIST, "SERVER: Teleport Locations", "House Interiors\nRace Tracks\nCity Locations\nPopular Locations\nGym Interiors\nOther", "Select", "Cancel");
else SendClientMessage(playerid, COLOR_WHITE, "Only admins are allowed to use this command!");
return 1;
}
|
|
You need to use control structures properly, please read this:
https://sampwiki.blast.hk/wiki/Control_Structures#if If you want it for all admin levels, try: Код:
CMD:go(playerid)
{
if(PlayerInfo[playerid][pAdminLevel] => 1) ShowPlayerDialog(playerid, DIALOG_GO, DIALOG_STYLE_LIST, "SERVER: Teleport Locations", "House Interiors\nRace Tracks\nCity Locations\nPopular Locations\nGym Interiors\nOther", "Select", "Cancel");
else SendClientMessage(playerid, COLOR_WHITE, "Only admins are allowed to use this command!");
return 1;
}
|
if(PlayerInfo[playerid][pAdminLevel]) //or if(PlayerInfo[playerid][pAdminLevel] > 0)
if(!PlayerInfo[playerid][pAdminLevel]) //or if(PlayerInfo[playerid][pAdminLevel] < 1)
CMD:go(playerid)
{
if(PlayerInfo[playerid][pAdminLevel] >= 1) ShowPlayerDialog(playerid, DIALOG_GO, DIALOG_STYLE_LIST, "SERVER: Teleport Locations", "House Interiors\nRace Tracks\nCity Locations\nPopular Locations\nGym Interiors\nOther", "Select", "Cancel");
else SendClientMessage(playerid, COLOR_WHITE, "Only admins are allowed to use this command!");
return 1;
}
|
My bad, try:
Код:
CMD:go(playerid)
{
if(PlayerInfo[playerid][pAdminLevel] >= 1) ShowPlayerDialog(playerid, DIALOG_GO, DIALOG_STYLE_LIST, "SERVER: Teleport Locations", "House Interiors\nRace Tracks\nCity Locations\nPopular Locations\nGym Interiors\nOther", "Select", "Cancel");
else SendClientMessage(playerid, COLOR_WHITE, "Only admins are allowed to use this command!");
return 1;
}
|