09.12.2012, 19:15
hey how i can make it /neon only admins can use .
// This command opens a menu where you can choose neons lights for your vehicle
COMMAND:neon(playerid, params[])
{
// Setup local variables
new OptionsList[200], DialogTitle[200];
// Send the command to all admins so they can see it
SendAdminText(playerid, "/neon", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player is the driver of a vehicle
if (GetPlayerVehicleSeat(playerid) == 0)
{
format(DialogTitle, sizeof(DialogTitle), "Vali valgustus:");
format(OptionsList, sizeof(OptionsList), "%sPolice lights\n", OptionsList);
format(OptionsList, sizeof(OptionsList), "%sRed lights\n", OptionsList);
format(OptionsList, sizeof(OptionsList), "%sBlue lights\n", OptionsList);
format(OptionsList, sizeof(OptionsList), "%sGreen lights\n", OptionsList);
format(OptionsList, sizeof(OptionsList), "%sYellow lights\n", OptionsList);
format(OptionsList, sizeof(OptionsList), "%sPink lights\n", OptionsList);
format(OptionsList, sizeof(OptionsList), "%sWhite lights\n", OptionsList);
format(OptionsList, sizeof(OptionsList), "%sRemove neons\n", OptionsList);
// Show the neon menu
ShowPlayerDialog(playerid, DialogNeon, DIALOG_STYLE_LIST, DialogTitle, OptionsList, "Vali", "Sule");
}
else
SendClientMessage(playerid, 0xFF0000FF, "Sa pole autojuht");
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}
// This command opens a menu where you can choose neons lights for your vehicle
COMMAND:neon(playerid, params[])
{
// Setup local variables
new OptionsList[200], DialogTitle[200];
// Send the command to all admins so they can see it
SendAdminText(playerid, "/neon", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player is the driver of a vehicle
if (GetPlayerVehicleSeat(playerid) == 0)
{
format(DialogTitle, sizeof(DialogTitle), "Vali valgustus:");
format(OptionsList, sizeof(OptionsList), "%sPolice lights\n", OptionsList);
format(OptionsList, sizeof(OptionsList), "%sRed lights\n", OptionsList);
format(OptionsList, sizeof(OptionsList), "%sBlue lights\n", OptionsList);
format(OptionsList, sizeof(OptionsList), "%sGreen lights\n", OptionsList);
format(OptionsList, sizeof(OptionsList), "%sYellow lights\n", OptionsList);
format(OptionsList, sizeof(OptionsList), "%sPink lights\n", OptionsList);
format(OptionsList, sizeof(OptionsList), "%sWhite lights\n", OptionsList);
format(OptionsList, sizeof(OptionsList), "%sRemove neons\n", OptionsList);
// Show the neon menu
ShowPlayerDialog(playerid, DialogNeon, DIALOG_STYLE_LIST, DialogTitle, OptionsList, "Vali", "Sule");
}
else
SendClientMessage(playerid, 0xFF0000FF, "Sa pole autojuht");
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}