Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2013-05-18, 18:11


akon823

Czekotubka :D






Wiek: 29
Na forum: 4816 dni
Posty: 399
Nick w MP: Remik14

Piwa: 152

Respekt: 76,8

Witam ;]
Mam komend? na zmian? pogody , lecz za ka?dym razem gdy wpisuje komend? to wyskakuje mi ''/pogoda [id pogody]'' i pogoda si? nie zmienia chocia? id jest prawid?owe...
By? mo?e kod jest z?y .

Kod:

CMD:pogoda(playerid, params[])
{
new gWorldStatus[3] = {12, 4};
new tmp[256];
new string[256];
new Ranga = gGracz[playerid][RangaAdmina];
if(Ranga >= 6 || IsPlayerVIP(playerid))
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "/pogoda [id pogody]");
return 1;
}
new weat;
weat = strval(tmp);
if (weat < 0 || weat > 46)
{
SendClientMessage(playerid, COLOR_ADMIN, "Z?e ID pogody");
return true;
}

gWorldStatus[1] = weat;

SetWeather(weat);

format(string, 128, "Zmieni?e? pogode na: %d", weat);
SendClientMessage(playerid, COLOR_GREEN, string);

return true;
}


Prosi?bym o wyt?umaczenie abym wiedzia? co ?le robie :D
Za pomoc daje piwka :p


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-18, 18:12


Sillence







Wiek: 26
Na forum: 5157 dni
Posty: 1514
Nick w MP: Sillence

Piwa: 1517

Respekt: 416,3
Respekt: 416,3

akon823, Zobacz tak:
Kod:

if(strcmp(cmd, "/pogoda", true) == 0) {
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, CZ, "Nie jeste? Administratorem !");
new string[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "SERVER: /pogoda [id pogody]");
return 1;
}
new pogoda;
pogoda = strval(tmp);

if (pogoda < 0 || pogoda > 46) {
SendClientMessage(playerid, CZERWONY, "AS: Z?e ID pogody");
return 1;
}
new gWorldStatus[3] = {12, 4};
gWorldStatus[1] = pogoda;
SetWeather(pogoda);
format(string, 128, "Administrator %s(ID:%s) zmieni? pogod? na %d",PlayerName(playerid), playerid, pogoda);
SendClientMessageToAll(POMARANCZOWY, string);
return 1;
}


Pozdrawiam :P

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-18, 18:26


akon823

Czekotubka :D






Wiek: 29
Na forum: 4816 dni
Posty: 399
Nick w MP: Remik14

Piwa: 152

Respekt: 76,8

Tym razem mam ca?y czas "Nie jeste? Administratorem"
Dodam , ?e pisze w systemie zcmd i by?oby fajnie jakby od razu by?o w zcmd :D i chce aby Nie tylko rcon mogl zmieniac pogode wi?c zamiast "IsPlayerAdmin" prosi?bym to
Kod:

new Ranga = gGracz[playerid][RangaAdmina];
if(Ranga >= 6 || IsPlayerVIP(playerid))


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-18, 18:43


IgrexolonO







Wiek: 34
Na forum: 6810 dni
Posty: 1386

Piwa: 1062

Respekt: 651,8
Respekt: 651,8Respekt: 651,8

Skoro ju? u?ywasz zcmd, to zacznij u?ywa? te? sscanfa..

Kod:

CMD:pogoda(playerid, params[])
{
if(Ranga >= 6 || IsPlayerVIP(playerid))
{
new weather;
if(sscanf(params, "d", weather)) return SendClientMessage(playerid, -1, "/pogoda [id pogodynki z polsatu]"), true;
if(weather < 0 || weather > 46) return SendClientMessage(playerid, COLOR_ADMIN, "Z?e ID pogody"), true;

gWorldStatus[1] = weather;
SetWeather(weather);

new stringah[30];
format(stringah, sizeof(stringah), "Zmieni?e? pogode na: %d", weather);
SendClientMessage(playerid, COLOR_GREEN, stringah);
} else SendClientMessage(playerid, -1, "Nie posiadasz odpowiedniej rangi!");
return true;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-18, 23:10


akon823

Czekotubka :D






Wiek: 29
Na forum: 4816 dni
Posty: 399
Nick w MP: Remik14

Piwa: 152

Respekt: 76,8

Dobra ju? wszystko ogarn??em dzi?ki wielkie pozdrawiam :>

Podpis
Postaw piwo autorowi tego posta
 

 
Tagi: komenda
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku