SA-MP Forums Archive
Error - 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: Error (/showthread.php?tid=607354)



Error - GoldenLion - 18.05.2016

When I try to compile this: http://pastebin.com/8pvhaWJs I get this error:
Код:
C:\Users\User\Documents\Desktop\Test.pwn(10) : error 010: invalid function or declaration
What's up with it?


Re: Error - SyS - 18.05.2016

Is that fullcode? if yes why you using playerid globally?


Re: Error - Sjn - 18.05.2016

You need to create the textdraw under OnPlayerConnect(playerid) callback. You just have it outside like that, it would surely give errors.


Re: Error - jona_jr - 18.05.2016

PHP код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#if defined FILTERSCRIPT
new PlayerText:Crosshair[MAX_PLAYERS];
public 
OnPlayerConnect(playerid){
    
Crosshair[playerid] = CreatePlayerTextDraw(playerid336.000030174.346618"X");
    
PlayerTextDrawLetterSize(playeridCrosshair[playerid], 0.2459980.987734);
    
PlayerTextDrawAlignment(playeridCrosshair[playerid], 1);
    
PlayerTextDrawColor(playeridCrosshair[playerid], -1);
    
PlayerTextDrawSetShadow(playeridCrosshair[playerid], 0);
    
PlayerTextDrawSetOutline(playeridCrosshair[playerid], 0);
    
PlayerTextDrawBackgroundColor(playeridCrosshair[playerid], 51);
    
PlayerTextDrawFont(playeridCrosshair[playerid], 2);
    
PlayerTextDrawSetProportional(playeridCrosshair[playerid], 1);
    return 
1;
}
forward RemoveCrosshair(playerid);
public 
RemoveCrosshair(playerid)
{
    
PlayerTextDrawHide(playeridCrosshair[playerid]);
}
public 
OnPlayerGiveDamage(playeriddamagedidFloatamountweaponidbodypart)
{
    
PlayerTextDrawShow(playeridCrosshair[playerid]);
    
SetTimer("RemoveCrosshair"500false);
    return 
1;
}
#endif 



Re: Error - GoldenLion - 18.05.2016

Quote:
Originally Posted by Sjn
Посмотреть сообщение
You need to create the textdraw under OnPlayerConnect(playerid) callback. You just have it outside like that, it would surely give errors.
Thanks.