SA-MP Forums Archive
I can not solve - 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: I can not solve (/showthread.php?tid=580235)



I can not solve - JoshNudock - 03.07.2015

Can someone help me? please.

Код:
C:\Users\2\Desktop\gamemode\gamemodes\2.pwn(1954) : error 028: invalid subscript (not an array or too many subscripts): "GetPlayerTargetDistance"
C:\Users\2\Desktop\gamemode\gamemodes\2.pwn(1954) : warning 215: expression has no effect
C:\Users\2\Desktop\gamemode\gamemodes\2.pwn(1954) : error 001: expected token: ";", but found "]"
C:\Users\2\Desktop\gamemode\gamemodes\2.pwn(1954) : error 029: invalid expression, assumed zero
C:\Users\2\Desktop\gamemode\gamemodes\2.pwn(1954) : fatal error 107: too many error messages on one line

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


5 Errors.
PHP код:
            new string0[32];
            
format(string0sizeof(string0), "~w~%d metros"GetPlayerTargetDistance[i]); //error :(
            
TextDrawSetString(SniperDistancia[i], string0); 



Re: I can not solve - [KHK]Khalid - 03.07.2015

GetPlayerTargetDistance is a function, not an array, right? You should have it like this maybe then..

pawn Код:
new string0[32];
format(string0, sizeof(string0), "~w~%d metros", GetPlayerTargetDistance(i));
TextDrawSetString(SniperDistancia[i], string0);



Re: I can not solve - JoshNudock - 03.07.2015

Warning?

Quote:

C:\Users\2\2\gamemode\gamemodes\2.pwn(1942) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.

stock GetPlayerTargetDistance(playerid)
{
new targetplayer = GetPlayerTargetPlayer(playerid);
new Float: tgPos[3];

GetPlayerPos(targetplayer, tgPos[0], tgPos[1], tgPos[2]);
new Float: value = GetPlayerDistanceFromPoint(playerid, tgPos[0], tgPos[1], tgPos[2]);

return value; //warning
}

tranks..


Re: I can not solve - kristo - 03.07.2015

As you're returning a float, the function must have a float tag as well.

pawn Код:
stock Float:GetPlayerTargetDistance(playerid)