|
93.6235,1921.1780,18.0469 |
public OnGameModeInit()
{
Position = TextDrawCreate(1.0, 5.6, "Welcome to the point");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 7.0, 93.6235,1921.1 780,18.0469))
{
TextDrawShowForPlayer(playerid,Position);
}
new string[35];
format(string, sizeof(string), "You are %0.2fm from the point.", GetPlayerDistanceFromPoint(playerid, 93.6235, 1921.1780, 18.0469));
// Update textdraw with 'string'
|
New Float:distance,string[200];
distance = GetPlayerDistanceFromPoint(playerid,93.6235,1921.1 780,18.0469); format(string,200,"Distance:%0.2f",distance); PlayerTextDrawSetString(playerid,textdraw[playerid],string); Enjoy ![]() |
(130) :error 017: undefined symbol "playerid"
(130) : warning 215: expression has no effect
(130) : warning 215: expression has no effect
(130) : error 001: expected token: ";", but found ")"
(130) : error 029: invalid expression, assumed zero
(130) : fatal error 107: too many error messages on one line
|
I am using this in on under gamemodeinit
it shows me the following errors PHP код:
|
|
I can help you with some errors/warnings.
OnGameModeInit there is no playerid defined, so you simply cannot use it. You can use: [pawno] for (new i = 0; i < MAX_PLAYERS; i++) { The stuff here } [/pawno] Then for the expected token ";", you forgot the ";" where you closed a function with ). |
for (new i = 0; i < MAX_PLAYERS; i++)
new Float:distance,string[200]; //line 130
distance = GetPlayerDistanceFromPoint(i,93.6235,1921.1 780,18.0469);
format(string,200,"Distance:%0.2f",distance);
PlayerTextDrawSetString(playerid,textdraw3d,string);
(130) : error 003: declaration of a local variable must appear in a compound block
(130) : warning 221: label name "Float" shadows tag name
(130) : error 017: undefined symbol "distance"
(130) : warning 215: expression has no effect
(130) : error 001: expected token: ";", but found "]"
(130) : fatal error 107: too many error messages on one line