20.12.2011, 05:26
Hi there,
How to make it that when u set the weather in my dialog, it only sets the weather for that person and not the whole server?
Dialog:
My vipweather command:
How to make it that when u set the weather in my dialog, it only sets the weather for that person and not the whole server?
Dialog:
pawn Код:
Dialog_VipWeather(playerid, response, listitem)
{
// Just close the dialog if the player clicked "Cancel"
if(!response) return 1;
// Setup local variables
new WeatherID;
// Select the weather
switch (listitem)
{
case 0: WeatherID = 0; // Normal
case 1: WeatherID = 8; // Stormy
case 2: WeatherID = 9; // Foggy
case 3: WeatherID = 11; // Scorching hot
case 4: WeatherID = 16; // Dull, cloudy, rainy
case 5: WeatherID = 19; // Sandstorm
case 6: WeatherID = 20; // Green Fog
case 7: WeatherID = 33; // Dark, cloudy, brown
case 8: WeatherID = 39; // Extremely bright
case 9: WeatherID = 43; // Dark toxic clouds
case 10: WeatherID = 44; // Black & white sky
}
// Set the weather
SetWeather(WeatherID); // this sets it for whole server but how to make it only for player?
// Inform the player about it
SendClientMessage(playerid, 0xFFFFFFFF, "You have changed the weather!");
return 1;
}
pawn Код:
COMMAND:vipweather(playerid, params[])
{
// Send the command to all admins so they can see it
SendAdminText(playerid, "/vipweather", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player is vip
if (APlayerData[playerid][PlayerLevel] >= 1)
{
// Let the player select a weather-type
ShowPlayerDialog(playerid, DialogVipWeather, DIALOG_STYLE_LIST, "Select weather type:", "Normal\nStormy\nFoggy\nScorching Hot\nDull, cloudy, rainy\nSandstorm\nGreen Fog\nDark, cloudy, brown\nExtremely bright\nDark toxic clouds\nBlack & white sky", "Select", "Cancel");
}
else
return 0;
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}