SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 23/11/2017, 09:44 PM   #1
Lant
Big Clucker
 
Join Date: Jun 2012
Posts: 160
Reputation: 12
Default Im in a complete dead end.

Im not going to make a new post, I found the solution to the old problem, now its this one:
I dont see whats wrong with them...

Quote:
C:\Users\tiiu\Desktop\1337\pawno\include\YSF.inc(7 1) : error 021: symbol already defined: "GetObjectModel"
C:\Users\tiiu\Desktop\1337\pawno\include\YSF.inc(8 3) : error 021: symbol already defined: "GetPlayerObjectModel"
scrp/vara.pwn(8295) : error 021: symbol already defined: "cmd_lisam2rk"
scrp/vara.pwn(8321) : error 021: symbol already defined: "cmd_eemaldam2rk"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Lines:
Code:
YSF.inc(71): native GetObjectModel(objectid);
YSF.inc(83): native GetPlayerObjectModel(playerid, objectid);

Quote:
CMD:lisam2rk(playerid, p[])
{ //------------ THIS IS THE LINE vara.pwn(8295)
if (KasutajaInfo[playerid][mAdmin] < 5) return SCM(playerid, COLOR_RED, "Sa pead selle käskluse kasutamiseks olema vähemalt level 3 administraator.");
if (Iter_Count(Liiklusmargid) >= MAX_MARGID) return SCM(playerid, COLOR_RED, "Praegu ei saa liiklusmärke lisada (Limiit on täis)."), printf("[VIGA]: Taksofonide maksimaalne arv (MAX_PAYPHONES = %i) on täis/ületatud!", MAX_PAYPHONES);
new type, tekst[12];
if (sscanf(p, "iS()[12]", type, tekst)) return SCM(playerid, COLOR_WHITE, "KASUTUS: /lisamärk <Märgi tüüp (0 - 22)> <Tekst (Vajadusel)>");
if (type < 0 || type > 22) return SCM(playerid, COLOR_WHITE, "KASUTUS: /lisamärk <Märgi tüüp (0 - 22)> <Tekst (Vajadusel)>");
new string[512], Floatos[4];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetXYInFrontOfPlayer(playerid, pos[0], pos[1], 1);
GetPlayerFacingAngle(playerid, pos[3]);
mysql_format(db, string, sizeof(string), "INSERT INTO liiklusmargid (posX, posY, posZ, rot, type, tekst) VALUES ('%f', '%f', '%f', '%f', %i, '%e')",
pos[0], pos[1], pos[2], pos[3], type, tekst);
new Cache:r = mysql_query(db, string), id = cache_insert_id();
cache_delete(r);
new id2 = Iter_Free(Liiklusmargid);
MargiInfo[id2][mID] = id;
MargiInfo[id2][mType] = type;
safestrcpy(MargiInfo[id2][mText], tekst, 12);
for (new i; i < 4; i++) MargiInfo[id2][mPos][i] = pos[i];
CreateTrafficSign(id2, type, pos[0], pos[1], pos[2], pos[3], 200, tekst);
Iter_Add(Liiklusmargid, id2);
SCM(playerid, COLOR_WHITE, "Lisasid liiklusmärgi!");
return 1;
}

CMD:eemaldam2rk(playerid, p[])
{ //-------- THIS IS THE LINE vara.pwn(8321)!
if (KasutajaInfo[playerid][mAdmin] < 5) return SCM(playerid, COLOR_RED, "Sa pead selle käskluse kasutamiseks olema vähemalt level 3 administraator.");
tegevusobjektiga[playerid] = SELECT_OBJECT_SIGN;
SCM(playerid, COLOR_WHITE, "Vali liiklusmärk, mida soovid eemaldada.");
SelectObject(playerid);
return 1;
}

Last edited by Lant; 23/11/2017 at 11:18 PM.
Lant is offline   Reply With Quote
Old 23/11/2017, 09:55 PM   #2
H4bdel
Little Clucker
 
Join Date: Sep 2016
Posts: 16
Reputation: 4
Default Re: Im in a complete dead end.

I remember having a problem of the same kind before but I don't remember how I fixed it, you could try using this website to indent your code and find the missing bracket. Good luck

H4bdel is offline   Reply With Quote
Old 23/11/2017, 10:30 PM   #3
Lant
Big Clucker
 
Join Date: Jun 2012
Posts: 160
Reputation: 12
Default Re: Im in a complete dead end.

Quote:
Originally Posted by H4bdel View Post
I remember having a problem of the same kind before but I don't remember how I fixed it, you could try using this website to indent your code and find the missing bracket. Good luck
I dont understand how to use the website you reffered to... I pasted my script, but clicking "Fix Identation" doesent do anything.
Lant is offline   Reply With Quote
Old 23/11/2017, 10:35 PM   #4
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,453
Reputation: 413
Default Re: Im in a complete dead end.

Compiler crashes aren't just because of missing brackets, it could be a multitude of other things (for example, directly returning a string; return "yes"). You can try compiling with Zeexs compiler, it has quite a few compiler bugs fixed that could cause this.
Abagail is offline   Reply With Quote
Old 23/11/2017, 10:59 PM   #5
Lant
Big Clucker
 
Join Date: Jun 2012
Posts: 160
Reputation: 12
Default Re: Im in a complete dead end.

Quote:
Originally Posted by Abagail View Post
Compiler crashes aren't just because of missing brackets, it could be a multitude of other things (for example, directly returning a string; return "yes"). You can try compiling with Zeexs compiler, it has quite a few compiler bugs fixed that could cause this.
Mate, I love you! I found out what causes the crashes, tyvm. +Rep for sure.
Lant is offline   Reply With Quote
Old 23/11/2017, 11:04 PM   #6
Lant
Big Clucker
 
Join Date: Jun 2012
Posts: 160
Reputation: 12
Default Re: Im in a complete dead end.

One more thing, it gives me errors on YSF.inc but I havent changed it...

Quote:
C:\Users\tiiu\Desktop\1337\pawno\include\YSF.inc(7 1) : error 021: symbol already defined: "GetObjectModel"
C:\Users\tiiu\Desktop\1337\pawno\include\YSF.inc(8 3) : error 021: symbol already defined: "GetPlayerObjectModel"
scrp/vara.pwn(8295) : error 021: symbol already defined: "cmd_lisam2rk"
scrp/vara.pwn(8321) : error 021: symbol already defined: "cmd_eemaldam2rk"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Lines:
Code:
YSF.inc(71): native GetObjectModel(objectid);
YSF.inc(83): native GetPlayerObjectModel(playerid, objectid);

Code:
CMD:lisam2rk(playerid, p[])
{ //------------ THIS IS THE LINE vara.pwn(8295)
    if (KasutajaInfo[playerid][mAdmin] < 5) return SCM(playerid, COLOR_RED, "Sa pead selle käskluse kasutamiseks olema vähemalt level 3 administraator.");
    if (Iter_Count(Liiklusmargid) >= MAX_MARGID) return SCM(playerid, COLOR_RED, "Praegu ei saa liiklusmärke lisada (Limiit on täis)."), printf("[VIGA]: Taksofonide maksimaalne arv (MAX_PAYPHONES = %i) on täis/ületatud!", MAX_PAYPHONES);
    new type, tekst[12];
	if (sscanf(p, "iS()[12]", type, tekst)) return SCM(playerid, COLOR_WHITE, "KASUTUS: /lisamärk <Märgi tüüp (0 - 22)> <Tekst (Vajadusel)>");
	if (type < 0 || type > 22) return SCM(playerid, COLOR_WHITE, "KASUTUS: /lisamärk <Märgi tüüp (0 - 22)> <Tekst (Vajadusel)>");
	new string[512], Float:pos[4];
	GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    GetXYInFrontOfPlayer(playerid, pos[0], pos[1], 1);
    GetPlayerFacingAngle(playerid, pos[3]);
	mysql_format(db, string, sizeof(string), "INSERT INTO liiklusmargid (posX, posY, posZ, rot, type, tekst) VALUES ('%f', '%f', '%f', '%f', %i, '%e')",
	pos[0], pos[1], pos[2], pos[3], type, tekst);
	new Cache:r = mysql_query(db, string), id = cache_insert_id();
	cache_delete(r);
	new id2 = Iter_Free(Liiklusmargid);
	MargiInfo[id2][mID] = id;
	MargiInfo[id2][mType] = type;
	safestrcpy(MargiInfo[id2][mText], tekst, 12);
	for (new i; i < 4; i++) MargiInfo[id2][mPos][i] = pos[i];
	CreateTrafficSign(id2, type, pos[0], pos[1], pos[2], pos[3], 200, tekst);
    Iter_Add(Liiklusmargid, id2);
	SCM(playerid, COLOR_WHITE, "Lisasid liiklusmärgi!");
	return 1;
}

CMD:eemaldam2rk(playerid, p[])
{ //-------- THIS IS THE LINE vara.pwn(8321)!
    if (KasutajaInfo[playerid][mAdmin] < 5) return SCM(playerid, COLOR_RED, "Sa pead selle käskluse kasutamiseks olema vähemalt level 3 administraator.");
    tegevusobjektiga[playerid] = SELECT_OBJECT_SIGN;
    SCM(playerid, COLOR_WHITE, "Vali liiklusmärk, mida soovid eemaldada.");
    SelectObject(playerid);
	return 1;
}
Lant is offline   Reply With Quote
Old 24/11/2017, 12:20 AM   #7
Lant
Big Clucker
 
Join Date: Jun 2012
Posts: 160
Reputation: 12
Default Re: Im in a complete dead end.

Anyone? .
Lant is offline   Reply With Quote
Old 24/11/2017, 12:28 AM   #8
Sew_Sumi
Godfather
 
Join Date: Jun 2008
Posts: 4,998
Reputation: 378
Default Re: Im in a complete dead end.

Quote:
Originally Posted by H4bdel View Post
I remember having a problem of the same kind before but I don't remember how I fixed it, you could try using this website to indent your code and find the missing bracket. Good luck
Pretty sure uncrustify will do a better job than that webpage...
Sew_Sumi is offline   Reply With Quote
Old 24/11/2017, 12:49 AM   #9
Lant
Big Clucker
 
Join Date: Jun 2012
Posts: 160
Reputation: 12
Default Re: Im in a complete dead end.

Quote:
Originally Posted by Sew_Sumi View Post
Pretty sure uncrustify will do a better job than that webpage...
I already found out the issue he is commenting about, now I have a new problem (Check the top). I also tried to use uncrustify but I dont understand how it works.
Lant is offline   Reply With Quote
Old 24/11/2017, 04:12 AM   #10
Sew_Sumi
Godfather
 
Join Date: Jun 2008
Posts: 4,998
Reputation: 378
Default Re: Im in a complete dead end.

Quote:
Originally Posted by Lant View Post
I also tried to use uncrustify but I dont understand how it works.
Very easy...

Code:
uncrustify.exe -c ./cfg/defaults.cfg -f fucked.txt > unfucked.txt
(That's just what I have setup in a batch file to run on random code that has problems. (I think it'll just fix indentation, just for readability in it's current setup))
Sew_Sumi is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to complete the dead Effin body and place it on ground? Norrin Scripting Help 3 02/09/2014 05:53 PM
Who can complete me this script pls? 123bob123 Scripting Help 12 06/07/2014 04:01 PM
[GameMode] [GM] Complete War MrXavier Gamemode Scripts 22 02/04/2013 11:25 AM
Is there a way to remove the COMPLETE map? justsomeguy Scripting Help 12 23/12/2011 03:44 PM
Specating enemy after dead if team #1 is fully dead LifeStyle Help Archive 22 04/09/2010 01:53 PM


All times are GMT. The time now is 11:24 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.