Code fix please?
#1

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 
Reply
#2

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

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
. 
Reply
#4

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...
Reply
#5

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.
Reply
#6

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!
Reply
#7

You are welcome
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)