SA-MP Forums Archive
Code fix please? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Code fix please? (/showthread.php?tid=559447)



Code fix please? - marshallbrown - 23.01.2015

Can someone fix this line? New to scripting.

PHP код:
    HouseInfo[iIndex][hTextID] = CreateDynamic3DTextLabel(szFileStr, COLOR_GREEN, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ]+0.5,30.0, .testlos = 1, .distance = 30.0); 
Errors:

PHP код:
D:\[Do Not Open] ROHAN\test\New Folder\gamemodes\KGRP.pwn(16897) : error 017: undefined symbol "distance"
D:\[Do Not Open] ROHAN\test\New Folder\gamemodes\SLRP.pwn(16897) : warning 215: expression has no effect
D
:\[Do Not Open] ROHAN\test\New Folder\gamemodes\SLRP.pwn(16897) : error 001: expected token: ";", but found ")"
D:\[Do Not Open] ROHAN\test\New Folder\gamemodes\SLRP.pwn(16897) : error 029: invalid expression, assumed zero
D
:\[Do Not Open] ROHAN\test\New Folder\gamemodes\SLRP.pwn(16897) : fatal error 107: too many error messages on one line 



Re: Code fix please? - nezo2001 - 23.01.2015

PHP код:
HouseInfo[iIndex][hTextID] = CreateDynamic3DTextLabel(szFileStr, COLOR_GREEN, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ]+0.5,30.0, 1, 30.0); 



Re: Code fix please? - marshallbrown - 23.01.2015

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
PHP код:
HouseInfo[iIndex][hTextID] = CreateDynamic3DTextLabel(szFileStr, COLOR_GREEN, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ]+0.5,30.0, 1, 30.0); 
Bro, This one?

PHP код:
    HouseInfo[iIndex][hTextID] = CreateDynamic3DTextLabel(szFileStr, COLOR_GREEN, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ]+0.5,30.0, .testlos = 1, .distance = 30.0); 
Errors:
PHP код:
D:\[Do Not Open] ROHAN\test\New Folder\gamemodes\KGRP.pwn(16897) : warning 213: tag mismatch
D
:\[Do Not Open] ROHAN\test\New Folder\gamemodes\KGRP.pwn(16898) : error 001: expected token: "-identifier-", but found "="
D:\[Do Not Open] ROHAN\test\New Folder\gamemodes\KGRP.pwn(16898) : warning 215: expression has no effect
D
:\[Do Not Open] ROHAN\test\New Folder\gamemodes\KGRP.pwn(16898) : error 001: expected token: ";", but found ")"
D:\[Do Not Open] ROHAN\test\New Folder\gamemodes\KGRP.pwn(16898) : error 029: invalid expression, assumed zero
D
:\[Do Not Open] ROHAN\test\New Folder\gamemodes\KGRP.pwn(16898) : fatal error 107: too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664     Copyright (coffee) 1997-2006, ITB CompuPhase
4 Errors
. 



Re: Code fix please? - nezo2001 - 23.01.2015

you can't use it like this
PHP код:
 HouseInfo[iIndex][hTextID] = CreateDynamic3DTextLabel(szFileStr, COLOR_GREEN, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ]+0.5,30.0, .testlos = 1, .distance = 30.0); 
Remove
PHP код:
.testlos = //and
.distance = 
Put instead of them the number directly...


Re: Code fix please? - Detoria - 23.01.2015

When the compiler says "undefined symbol",that means that the variable in question didn't exist,so,you don't have the var "distance" and remember,for positions,life bar,armour bar and things that can have any value,use new Float:.

And why are you putting those dots in front of the variables ?
You can only creatr variables with "new",on stock functions or on forward functions,the native functions don't allow you to do those things.


Re: Code fix please? - marshallbrown - 23.01.2015

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
you can't use it like this
PHP код:
 HouseInfo[iIndex][hTextID] = CreateDynamic3DTextLabel(szFileStr, COLOR_GREEN, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ]+0.5,30.0, .testlos = 1, .distance = 30.0); 
Remove
PHP код:
.testlos = //and
.distance = 
Put instead of them the number directly...
Worked like a charm! Thanks alot!


Re: Code fix please? - nezo2001 - 23.01.2015

You are welcome