Započeo [JV:RP] Milos
•12. Jan. 2014.• Zaključano[Pomoc]Rastojanje
960
pregleda
13
postova
Underboss
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
601
Postovi:
93
Teme:
Pridružio se:Sep. 2013
12. Jan. 2014.
Ime skripte: FC-RP
Opis problema: Pa ovako za sadnju droge kada kucam /drugs plant i onda pojavi se objekat biljke ali mogu da sadim jednu na drugu kako da uradim da se recimo rastojanje da bude u 3 4 metra,znaci samo mi treba rastojanje da ne moze da se sadi jenu na drugu
Opis problema: Pa ovako za sadnju droge kada kucam /drugs plant i onda pojavi se objekat biljke ali mogu da sadim jednu na drugu kako da uradim da se recimo rastojanje da bude u 3 4 metra,znaci samo mi treba rastojanje da ne moze da se sadi jenu na drugu
if(strcmp(cmd, "/drugsplant", true) == 0 || strcmp(cmd, "/saditravu", true) == 0)
{
if (!PlayerInfo) return SendClientMessage(playerid, COLOR_GREY,"Nemate semenke!");
{
for(new weed = 0; weed < sizeof(WeedInfo); weed++)
{
if(!PlayerToPoint(420.0,playerid, 2211.4373,-487.3233,114.0355)) return SendClientMessage(playerid,COLOR_GREY,"Niste u zoni gde mozete saditi marihuanu!");
{
if(WeedInfo == 0 && WeedInfo == 0)
{
if(PlayerInfo == 5 || PlayerInfo == 5 || PlayerInfo == 13 || PlayerInfo == 13)
{
if (GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_WHITE, "Ne mozete saditi dok ste u vozilu!");
if (GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, COLOR_WHITE, "Ne mozes ovde saditi marihuanu!");
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerName(playerid, playername, 24);
ApplyAnimation(playerid, "BOMBER","BOM_Plant",4.0,0,0,0,0,0);
weedObject = CreateObject(19473, X, Y, Z-2, 0, 0, 0);
Weeder = 1200;
WeedInfo = X;
WeedInfo = Y;
WeedInfo = Z;
WeedInfo = 20;
WeedInfo = 1;
strmid(WeedInfo, playername, 0, strlen(playername), 50);
SendClientMessage(playerid,COLOR_FADE1,"Posadili ste marihuanu, sacekajte da naraste pa je uberite!");
//SendClientMessage(playerid,COLOR_FADE1,"Remember to type /pickweed Before someone else takes your weed!");
PlayerInfo -= 1;
WATER -= 1;
return 1;
}
}
}
}
}
}OG Legend
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
246 / 250 XP
Početnik(0)
2,678
Postovi:
133
Teme:
Pridružio se:Maj 2012
12. Jan. 2014.
Cekaj ti si to napravio da mozes bilo gde da sadis ili .. 😄 mada vidim u scripti da imas neku lokaciju za to mozda da uradis polja na kojima se moze saditi da ne gomila 100 puta na jednu te istu tacku ako si me razumeo
Underboss
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
601
Postovi:
93
Teme:
Pridružio se:Sep. 2013
Underboss
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
666
Postovi:
43
Teme:
Pridružio se:Avg. 2012
12. Jan. 2014.
stock GetDistance( Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2 )
{
return floatround( floatsqroot( ( ( x1 - x2 ) * ( x1 - x2 ) ) + ( ( y1 - y2 ) * ( y1 - y2 ) ) + ( ( z1 - z2 ) * ( z1 - z2 ) ) ) ) );
}Mozda ti ovo pomogne, da izracunas razmak izmedju dvije tacke, pa provjeris jel razmak manji ili jednak da ne moze sadit.
Underboss
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
601
Postovi:
93
Teme:
Pridružio se:Sep. 2013
13. Jan. 2014.
imam ove errore ovo sma stavio gde stoje stock-ovi
C:\Users\x7\Desktop\NAJ NOVIJI FC\2013\Faction City\gamemodes\BOZIC.pwn(62690) : error 025: function heading differs from prototype
C:\Users\x7\Desktop\NAJ NOVIJI FC\2013\Faction City\gamemodes\BOZIC.pwn(62691) : error 021: symbol already defined: "GetDistance"Underboss
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
601
Postovi:
93
Teme:
Pridružio se:Sep. 2013
Underboss
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
601
Postovi:
93
Teme:
Pridružio se:Sep. 2013
Underboss
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
666
Postovi:
43
Teme:
Pridružio se:Avg. 2012
16. Jan. 2014.
,,Gdje stoje stockovi" XDDDDDD
Btw jesi siguran da nemas vec definisano 'GetDistance' u skripti, pokusaj promjenit naziv.
stock GetDistance( Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2 )
return floatround( floatsqroot( ( ( x1 - x2 ) * ( x1 - x2 ) ) + ( ( y1 - y2 ) * ( y1 - y2 ) ) + ( ( z1 - z2 ) * ( z1 - z2 ) ) ) ) );Btw jesi siguran da nemas vec definisano 'GetDistance' u skripti, pokusaj promjenit naziv.
Underboss
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
601
Postovi:
93
Teme:
Pridružio se:Sep. 2013
16. Jan. 2014.
evo napravio sam
evo erorra 🙂
#define GetDistanceevo erorra 🙂
C:\Users\x7\Desktop\NAJ NOVIJI FC\2013\Faction City\pawno\include\morphinc.inc(3) : warning 219: local variable "x2" shadows a variable at a preceding level
C:\Users\x7\Desktop\NAJ NOVIJI FC\2013\Faction City\pawno\include\morphinc.inc(3) : warning 219: local variable "y2" shadows a variable at a preceding level
C:\Users\x7\Desktop\NAJ NOVIJI FC\2013\Faction City\pawno\include\morphinc.inc(3) : warning 219: local variable "z2" shadows a variable at a preceding level
C:\Users\x7\Desktop\NAJ NOVIJI FC\2013\Faction City\gamemodes\BOZIC.pwn(1229) : error 010: invalid function or declaration
C:\Users\x7\Desktop\NAJ NOVIJI FC\2013\Faction City\gamemodes\BOZIC.pwn(3303) : warning 219: local variable "x2" shadows a variable at a preceding level
C:\Users\x7\Desktop\NAJ NOVIJI FC\2013\Faction City\gamemodes\BOZIC.pwn(3303) : warning 219: local variable "y2" shadows a variable at a preceding level
C:\Users\x7\Desktop\NAJ NOVIJI FC\2013\Faction City\gamemodes\BOZIC.pwn(3303) : warning 219: local variable "z2" shadows a variable at a preceding levelHustler
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
40 / 100 XP
Početnik(0)
53
Postovi:
3
Teme:
Pridružio se:Avg. 2013
16. Jan. 2014.
if(strcmp(cmd, "/drugsplant", true) == 0 || strcmp(cmd, "/saditravu", true) == 0)
{
if (!PlayerInfo) return SendClientMessage(playerid, COLOR_GREY,"Nemate semenke!");
{
for(new weed = 0; weed < sizeof(WeedInfo); weed++)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(!PlayerToPoint(420.0,playerid, 2211.4373,-487.3233,114.0355)) return SendClientMessage(playerid,COLOR_GREY,"Niste u zoni gde mozete saditi marihuanu!");
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, WeedInfo, WeedInfo, WeedInfo)) return SendClientMessage(playerid, COLOR_WHITE, "Odmaknite se od vec zasadjene bilje");
if(WeedInfo == 0 && WeedInfo == 0)
{
if(PlayerInfo == 5 || PlayerInfo == 5 || PlayerInfo == 13 || PlayerInfo == 13)
{
if (GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_WHITE, "Ne mozete saditi dok ste u vozilu!");
if (GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, COLOR_WHITE, "Ne mozes ovde saditi marihuanu!");
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerName(playerid, playername, 24);
ApplyAnimation(playerid, "BOMBER","BOM_Plant",4.0,0,0,0,0,0);
weedObject = CreateObject(19473, X, Y, Z-2, 0, 0, 0);
Weeder = 1200;
WeedInfo = X;
WeedInfo = Y;
WeedInfo = Z;
WeedInfo = 20;
WeedInfo = 1;
strmid(WeedInfo, playername, 0, strlen(playername), 50);
SendClientMessage(playerid,COLOR_FADE1,"Posadili ste marihuanu, sacekajte da naraste pa je uberite!");
//SendClientMessage(playerid,COLOR_FADE1,"Remember to type /pickweed Before someone else takes your weed!");
PlayerInfo -= 1;
WATER -= 1;
return 1;
}
}
}
}
}
}Dodao sam ovo.
if(IsPlayerInRangeOfPoint(playerid, 3.0, WeedInfo, WeedInfo, WeedInfo)) return SendClientMessage(playerid, COLOR_WHITE, "Odmaknite se od vec zasadjene bilje");Ako ti ne odgovara radius koji sam postavio promjeni.Underboss
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
601
Postovi:
93
Teme:
Pridružio se:Sep. 2013
17. Jan. 2014.
Hvala radi ali imam ove warrning-e
C:\Users\x7\Desktop\NAJ NOVIJI FC\2013\Faction City\gamemodes\BOZIC.pwn(48258) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\x7\Desktop\NAJ NOVIJI FC\2013\Faction City\gamemodes\BOZIC.pwn(48258) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\x7\Desktop\NAJ NOVIJI FC\2013\Faction City\gamemodes\BOZIC.pwn(48258) : warning 219: local variable "Z" shadows a variable at a preceding levelUnderboss
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
666
Postovi:
43
Teme:
Pridružio se:Avg. 2012
17. Jan. 2014.
mogao bi ovako da ti radi:
ali bi ti mozda opet se negdje javio problem kad bi X,Y,Z koristio, pa preporucujem da pogledas gdje si radio, vjerovatno nisi iskoristio kreirane varijable negdje kako treba.
new Float:Xaaa,Float:Yaaa,Float:Zaaa;
GetPlayerPos(playerid, Xaaa,Yaaa, Zaaa);ali bi ti mozda opet se negdje javio problem kad bi X,Y,Z koristio, pa preporucujem da pogledas gdje si radio, vjerovatno nisi iskoristio kreirane varijable negdje kako treba.
Hustler
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
40 / 100 XP
Početnik(0)
53
Postovi:
3
Teme:
Pridružio se:Avg. 2013
17. Jan. 2014.
if(strcmp(cmd, "/drugsplant", true) == 0 || strcmp(cmd, "/saditravu", true) == 0)
{
if (!PlayerInfo) return SendClientMessage(playerid, COLOR_GREY,"Nemate semenke!");
{
for(new weed = 0; weed < sizeof(WeedInfo); weed++)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(!PlayerToPoint(420.0,playerid, 2211.4373,-487.3233,114.0355)) return SendClientMessage(playerid,COLOR_GREY,"Niste u zoni gde mozete saditi marihuanu!");
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, WeedInfo, WeedInfo, WeedInfo)) return SendClientMessage(playerid, COLOR_WHITE, "Odmaknite se od vec zasadjene bilje");
if(WeedInfo == 0 && WeedInfo == 0)
{
if(PlayerInfo == 5 || PlayerInfo == 5 || PlayerInfo == 13 || PlayerInfo == 13)
{
if (GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_WHITE, "Ne mozete saditi dok ste u vozilu!");
if (GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, COLOR_WHITE, "Ne mozes ovde saditi marihuanu!");
GetPlayerPos(playerid, X, Y, Z);
GetPlayerName(playerid, playername, 24);
ApplyAnimation(playerid, "BOMBER","BOM_Plant",4.0,0,0,0,0,0);
weedObject = CreateObject(19473, X, Y, Z-2, 0, 0, 0);
Weeder = 1200;
WeedInfo = X;
WeedInfo = Y;
WeedInfo = Z;
WeedInfo = 20;
WeedInfo = 1;
strmid(WeedInfo, playername, 0, strlen(playername), 50);
SendClientMessage(playerid,COLOR_FADE1,"Posadili ste marihuanu, sacekajte da naraste pa je uberite!");
//SendClientMessage(playerid,COLOR_FADE1,"Remember to type /pickweed Before someone else takes your weed!");
PlayerInfo -= 1;
WATER -= 1;
return 1;
}
}
}
}
}
}Morate biti prijavljeni da biste odgovorili na ovu temu.
Prijava