CMD:setweather(playerid,params[])
{
new string[128];
new sendername[MAX_PLAYER_NAME];
new weather;
if(sscanf(params, "u[32]", weather))
return SendClientMessage(playerid, RED, "[LOST:RP] /setweather [Weather ID]");
if(PlayerInfo[playerid][pAdmin] < 4)
return SendClientMessage(playerid, RED, "[LOST:RP] You are not high admin enough");
{
SetWeather(weather);
SendClientMessage(playerid, RED, "[LOST:RP] The weather has been changed");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "[LOST:RP] [ADMIN] %s has changed the weather to %d.", sendername,weather);
aMessage(COLOR_YELLOW,string,1);
}
return 1;
}
if(sscanf(params, "d", weather))
The format codes are: c - A character. d, i - An integer. h, x - A hex number (e.g. a colour). f - A float. s - A string. z - An optional string. pX - An additional delimiter where X is another character. '' - Encloses a litteral string to locate. u - User, takes a name, part of a name or an id and returns the id if they're connected.
} if (!strcmp("/setweather", cmdtext, true)) { new string[128]; new sendername[MAX_PLAYER_NAME]; new weather; if(sscanf(params, "d", weather)) return SendClientMessage(playerid, RED, "[LOST:RP] /setweather [Weather ID]"); if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, RED, "[LOST:RP] You are not high admin enough"); { SetWeather(weather); SendClientMessage(playerid, RED, "[LOST:RP] The weather has been changed"); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, 256, "[LOST:RP] [ADMIN] %s has changed the weather to %d.", sendername,weather); aMessage(COLOR_YELLOW,string,1); } return 1; }
new weather = strval(params);
That won't even work kvsolga.
Furthermore: pawn Код:
|