Wysłany: 2012-05-14, 17:04
kamil445
:D
Wiek: 29 Na forum: 6151 dni Posty: 119
Nick w MP: Czechu
Piwa : 882
PS: wiem, dziwna nazwa tematu ale nie wiedzia?em na to nazwa?
Jak przerobi? to by dzia?a?o w zcmd (to jest wyci?gni?te ze zwyk?ego systemu komend....
Kod: if (weat < 0 || weat > 46) {
jak to dam i gdy wpisze /komenda 3 to pisze ze zle id.
ca?a komenda:
Kod: CMD:weather(playerid, params[])//cmd by ja xDD
{
if(IsPlayerAdmin(playerid))
{
new Adminname[MAX_PLAYER_NAME];
GetPlayerName(playerid, Adminname, sizeof(Adminname));
new str[128];
new weat;
if (weat < 0 || weat > 46) {
format(str, sizeof(str), "[INFO] Zmieni?e?(a?) pogode na %d", weat);
SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
format(str, sizeof(str), "[INFO] Admin %s (ID: %d) Zmieni?(a) pogode na %d", Adminname, playerid, weat);
SendClientMessageToAll(COLOR_LIGHTBLUE, str);
SetWeather(weat);
}
else return SendClientMessage(playerid, 0xFF0000FF,"{24FF0A}[ERROR]: {FFFFFF}B??dne ID Pogody (0-46)!.");
}
else return SendClientMessage(playerid, 0xFF0000FF,"{24FF0A}[ERROR]: {FFFFFF}Nie jeste? Administratorem!.");
return 1;
}
za pomoc
Wysłany: 2012-05-14, 17:28
Quis
Wszechwiedzący
Wiek: 31 Na forum: 5146 dni Posty: 464
Nick w MP: Quis
Piwa : 1110
To:
Kod:
Zamie? na:
Kod: new weat = strval(params);
Po prostu tworzysz zmienn?, ale nic jej nie przypisujesz, a domy?lna warto?? to 0
No i warunek masz ?le, bo je?li ID b?dzie nieprawid?owe, to zmieni pogod?. Zamie? warunek na:
Kod: if (weat >= 0 && weat <= 46) {
Wysłany: 2012-05-14, 17:34
Seboo
Wiek: 30 Na forum: 5515 dni Posty: 124
Nick w MP: Sebo
Piwa : 1228
A nie lepiej tak ? : |
Kod: CMD:weather(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return 1;
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "* Podaj ID pogody.");
SetWeather(strval(params));
format(string, 256, "[INFO] Admin %s zmieni? pogod? na %d.", PlayerName(playerid), params);
SendClinetMessageToAll(COLOR_LIGHTBLUE, string);
return 1;
}
Wysłany: 2012-05-14, 17:57
kamil445
:D
Wiek: 29 Na forum: 6151 dni Posty: 119
Nick w MP: Czechu
Piwa : 882
"Seboo" napisał/a :A nie lepiej tak ? : |
Kod: CMD:weather(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return 1;
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "* Podaj ID pogody.");
SetWeather(strval(params));
format(string, 256, "[INFO] Admin %s zmieni? pogod? na %d.", PlayerName(playerid), params);
SendClinetMessageToAll(COLOR_LIGHTBLUE, string);
return 1;
}
mo?na i tak ale ja pisze po swojemu i jest gites
Tagi: warunek :: quotcośquot :: większe :: lub :: mniejsze
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: