Wysłany: 2013-08-20, 15:06
Sillence
Wiek: 26 Na forum: 5157 dni Posty: 1514
Nick w MP: Sillence
Piwa : 1517
Ja bym to zrobi? kr?cej:
Kod: if(strcmp("/cmd", cmdtext, true, 10) == 0)
{
static uzyta;
if((gettime() - uzyta) < 70)
{
SendClientMessage(playerid, -1, "Kto? inny u?y? tej komendy. Odczekaj 70 sekund");
return 1;
}
//Komenda
ostatniouzyta = gettime();
return 1;
}
Wysłany: 2013-08-20, 15:27
IgrexolonO
Wiek: 34 Na forum: 6809 dni Posty: 1386
Piwa : 1062
static? statica nie da si? zmieni?.
Po drugie static lokalnie? Nie s?dze ?e to w og?le zadzia?a.
Wysłany: 2013-08-20, 15:42
Qadax
Wiek: 36 Na forum: 4776 dni Posty: 36
Piwa : 3
"IgrexolonO" napisał/a : Kod:
cmd;
Kod: if(go?ombkiKrysi != true)
{
//komenda..
go?ombkiKrysi = true;
SetTimerEx("@_unblock", 700000, false);
}
Kod: forward @_unblock();
@_unblock()
{
go?ombkiKrysi = false;
return true;
}
Mam warning 202: number of arguments does not match definition
i nie dzia?a to poprawnie, ale zapewne to ja ?le rozmie?ci?em kod, oto jak to wygl?da:
Kod:
#include <a_samp>
#include <zcmd>
new balon;
new bool:golombkiKrysi;
forward powrot();
public OnGameModeInit()
{
CreateObject(8614, 2138.96, 1044.17, 11.80, 0.00, 0.00, -140.00);
CreateObject(3526, 2141.42, 1045.48, 13.09, 0.00, 0.00, 130.00);
CreateObject(5822, 2189.43, 1009.55, 76.50, 0.00, 0.00, 200.00);
Create3DTextLabel("Koszt lotu to 400$ /balon", 0x33CCFFFF, 2141.40, 1045.49, 14.12, 20.0, 0, 0);
balon = CreateObject(19336, 2142.40, 1044.22, 12.00, 0.00, 0.00, 40.00);
}
IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if (x >= minx && x <= maxx && y >= miny && y <= maxy) return 1;
return 0;
}
CMD:balon(playerid, params[])
{
if(golombkiKrysi != true)
{
SendClientMessage(playerid, 0x0, "{FD1313}{FFFFFF}W tym momencie trwa lot! Zaczekaj, a? balon wr?ci na l?dowisko!");
golombkiKrysi = true;
SetTimerEx("@_unblock", 700000, false);
}
if (!IsPlayerInArea(playerid, 2140.87, 2144.04, 1042.57, 1045.72))
{
SendClientMessage(playerid, 0x0, "{FD1313}{FFFFFF} Musisz by? w balonie!");
return 1;
}
else
{
if(GetPlayerMoney(playerid) < 400)
{
SendClientMessage(playerid,0xAA3333AA, "Nie sta? Ci? na lot.");
}
else
{
GivePlayerMoney(playerid,-400);
SendClientMessage(playerid,0xAA3333AA, "Lot balonem zosta? wykupiony. Podczas lotu prosimy nie biega?!");
MoveObject(balon, 2184.8882, 1008.5276, 82.0, 4);
SetTimer("powrot",30000,0);
return 1;
}
}
return 1;
}
public powrot()
{
MoveObject(balon, 2142.40, 1044.22, 12.00, 4);
return 1;
}
forward @_unblock();
@_unblock()
{
golombkiKrysi = false;
return true;
}
PS: Ten tw?j go?ombek ma polski znak ?, musia?em zmieni? n L.
Wysłany: 2013-08-20, 15:45
IgrexolonO
Wiek: 34 Na forum: 6809 dni Posty: 1386
Piwa : 1062
"Qadax" napisał/a :PS: Ten tw?j go?ombek ma polski znak ?, musia?em zmieni? n L.
P.S.: Sprawdza?em czy masz troch? oleju w g?owie.
Zajrz? do tego p??niej bo teraz udaj? si? w podr?? po ?wiecie, je?li bardzo Ci zale?y to wal za godzine na GG.
Wysłany: 2013-08-20, 16:10
Sillence
Wiek: 26 Na forum: 5157 dni Posty: 1514
Nick w MP: Sillence
Piwa : 1517
IgrexolonO , Zawsze mo?na zamieni? jak nie zadzia?a na new.
Wysłany: 2013-08-20, 16:11
Qadax
Wiek: 36 Na forum: 4776 dni Posty: 36
Piwa : 3
Nie b?d? przeszkadza?, jak b?dzie to pomo?esz, jak nie to kto? inny mo?e to zrobi.
Wysłany: 2013-08-20, 17:03
IgrexolonO
Wiek: 34 Na forum: 6809 dni Posty: 1386
Piwa : 1062
Kod: #include <a_samp>
#include <zcmd>
new balon;
new bool:golombkiKrysi;
public OnGameModeInit()
{
CreateObject(8614, 2138.96, 1044.17, 11.80, 0.00, 0.00, -140.00);
CreateObject(3526, 2141.42, 1045.48, 13.09, 0.00, 0.00, 130.00);
CreateObject(5822, 2189.43, 1009.55, 76.50, 0.00, 0.00, 200.00);
Create3DTextLabel("Koszt lotu to 400$ /balon", 0x33CCFFFF, 2141.40, 1045.49, 14.12, 20.0, 0, 0);
balon = CreateObject(19336, 2142.40, 1044.22, 12.00, 0.00, 0.00, 40.00);
}
IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if (x >= minx && x <= maxx && y >= miny && y <= maxy) return true;
return false;
}
CMD:balon(playerid, params[])
{
if(golombkiKrysi) return SendClientMessage(playerid, 0x0, "{FD1313}{FFFFFF}W tym momencie trwa lot! Zaczekaj, a? balon wr?ci na l?dowisko!"), true;
if(!IsPlayerInArea(playerid, 2140.87, 2144.04, 1042.57, 1045.72)) return SendClientMessage(playerid, 0x0, "{FD1313}{FFFFFF} Musisz by? w balonie!"), true;
if(GetPlayerMoney(playerid) < 400) return SendClientMessage(playerid,0xAA3333AA, "Nie sta? Ci? na lot."), true;
GivePlayerMoney(playerid,-400);
SendClientMessage(playerid,0xAA3333AA, "Lot balonem zosta? wykupiony. Podczas lotu prosimy nie biega?!");
MoveObject(balon, 2184.8882, 1008.5276, 82.0, 4);
SetTimer("powrot",30000,0);
golombkiKrysi = true;
SetTimer("@_unblock", 700000, false);
return true;
}
forward powrot();
public powrot()
{
MoveObject(balon, 2142.40, 1044.22, 12.00, 4);
return true;
}
forward @_unblock();
@_unblock()
{
golombkiKrysi = false;
return true;
}
Wysłany: 2013-08-20, 17:40
Qadax
Wiek: 36 Na forum: 4776 dni Posty: 36
Piwa : 3
No i gitara
Wszystko dzia?a
(ty tam 700 sekund zamiast 70 da?e? xd)
WYJA?NIONE - DO ZAMKNI?CIA
Tagi: teleport :: kilka :: miejsc
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: