Compilation Error
#1

C:\Users\Leighto\Desktop\GTA\Server\gamemodes\Serv er.pwn(16930) : error 017: undefined symbol "distance"
C:\Users\Leighto\Desktop\GTA\Server\gamemodes\Serv er.pwn(16930) : warning 215: expression has no effect
C:\Users\Leighto\Desktop\GTA\Server\gamemodes\Serv er.pwn(16930) : error 001: expected token: ";", but found ")"
C:\Users\Leighto\Desktop\GTA\Server\gamemodes\Serv er.pwn(16930) : error 029: invalid expression, assumed zero
C:\Users\Leighto\Desktop\GTA\Server\gamemodes\Serv er.pwn(16930) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

But on line ( 16930 ). It says 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);

I'm not sure what i did wrong? Can anyone help?
Reply
#2

Doesn't look like you've defined "Distance"
Reply
#3

remove the words .testlos and distance, also remove the
'=', just leave the numbers.
Reply
#4

Look at the parameters:

pawn Код:
native Text3D:CreateDynamic3DTextLabel(const text[], color, Float:x, Float:y, Float:z, Float:drawdistance, attachedplayer = INVALID_PLAYER_ID, attachedvehicle = INVALID_VEHICLE_ID, testlos = 0, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
It's streamdistance, not distance.

Quote:
Originally Posted by Jstylezzz
Посмотреть сообщение
remove the words .testlos and distance, also remove the
'=', just leave the numbers.
Do you actually know what .distance = 30 does? It passes the 'distance' parameter as 30, without passing the ~5 before it, making your code shorter and clearer. It's even useful if you're using all the parameters, as you know exactly which values you're passing to which parameter. For example, without that, his code would be:

(Note: No pawn tags as they hide some of the line. I want you to see it all.)

HouseInfo[iIndex][hTextID] = CreateDynamic3DTextLabel(szFileStr, COLOR_GREEN, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ]+0.5,30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 30);

Whereas with it:

HouseInfo[iIndex][hTextID] = CreateDynamic3DTextLabel(szFileStr, COLOR_GREEN, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ]+0.5,30.0, .testlos = 1, .streamdistance = 30.0);

In the first example, it's not at all clear which parameter is which.

For example:

pawn Код:
SendClientMessage(.color = 0xFF0000FF, .message = "Hello", .playerid = playerid);
Reply
#5

Oh wow, thanks for the quick replies guys. I will edit it soon and see what happens .
Reply
#6

Quote:
Originally Posted by MP2
Посмотреть сообщение
Look at the parameters:

pawn Код:
native Text3D:CreateDynamic3DTextLabel(const text[], color, Float:x, Float:y, Float:z, Float:drawdistance, attachedplayer = INVALID_PLAYER_ID, attachedvehicle = INVALID_VEHICLE_ID, testlos = 0, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
It's streamdistance, not distance.


Do you actually know what .distance = 30 does? It passes the 'distance' parameter as 30, without passing the ~5 before it, making your code shorter and clearer. It's even useful if you're using all the parameters, as you know exactly which values you're passing to which parameter. For example, without that, his code would be:

(Note: No pawn tags as they hide some of the line. I want you to see it all.)

HouseInfo[iIndex][hTextID] = CreateDynamic3DTextLabel(szFileStr, COLOR_GREEN, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ]+0.5,30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 30);

Whereas with it:

HouseInfo[iIndex][hTextID] = CreateDynamic3DTextLabel(szFileStr, COLOR_GREEN, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ]+0.5,30.0, .testlos = 1, .streamdistance = 30.0);

In the first example, it's not at all clear which parameter is which.

For example:

pawn Код:
SendClientMessage(.color = 0xFF0000FF, .message = "Hello", .playerid = playerid);
Wow thanks to you my server is working now , i'm new to scripting and now it works fine and compiles thank you so much.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)