SetPlayerWeather

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 21:58, 2 February 2014
Connor Mead (Talk | contribs)

← Previous diff
Revision as of 09:55, 11 May 2015
MP2 (Talk | contribs)

Next diff →
Line 1: Line 1:
{{Scripting}} {{Scripting}}
-{{Description|Set a player's [[WeatherID|weather]]. If [[TogglePlayerClock]] has been used to enable a player's clock, weather changes will interpolate (gradually change), otherwise will change instantly.}}+{{Description|Set a player's [[WeatherID|weather]].}}
{{Parameters|playerid, weather}} {{Parameters|playerid, weather}}
Line 12: Line 12:
public OnPlayerCommandText(playerid, cmdtext[]) public OnPlayerCommandText(playerid, cmdtext[])
{ {
- if(strcmp(cmdtext, "/storm", true) == 0)+ if(!strcmp(cmdtext, "/storm", true))
{ {
SetPlayerWeather(playerid, 8); SetPlayerWeather(playerid, 8);
Line 19: Line 19:
return 0; return 0;
} }
- 
</pawn> </pawn>
 +
 +{{Tip|If [[TogglePlayerClock]] is enabled, weather will slowly change over time, instead of changing instantly.}}
{{RelatedFunctions}} {{RelatedFunctions}}

Revision as of 09:55, 11 May 2015



Description:

Set a player's weather.


Parameters:
(playerid, weather)
playeridThe ID of the player whose weather to set.
weatherThe weather to set.


Return Values:

This function does not return any specific values.


public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/storm", true))
    {
        SetPlayerWeather(playerid, 8);
        return 1;
    }
    return 0;
}
Tip

Image:Light_bulb_icon.png

If TogglePlayerClock is enabled, weather will slowly change over time, instead of changing instantly.


Related Functions

The following functions may be useful, as they are related to this function in one way or another.

In other languages