SA-MP Forums Archive
Very small issue with a script. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Very small issue with a script. (/showthread.php?tid=180036)



Very small issue with a script. - Scriptissue - 29.09.2010

Ok so I was working on only allowing players to be able to buy mask only if they are in this certain point (on the script), seems like it doesn't work, they can use it all the time .
PHP код:
 if(strcmp(cmdtext,"/Mask",true) == 0)
{
for(new 
0MAX_PLAYERSi++)
 
ShowPlayerNameTagForPlayer(i,playerid,0);
 if(
IsPlayerConnected(playerid))
 if(
Mask == 0)return SendClientMessage(playerid,0xFF6C6CFF,"You don't have a mask !");
 if(
IsPlayerInRangeOfPoint(playerid11588.2670,-2324.5415,1461.6630))
 
DisableNameTagLOS();
  
GameTextForPlayer(playerid"~W~You have put ~g~ on"50005);
 return 
1;
 } 



Re: Very small issue with a script. - Scenario - 29.09.2010

I script differently then most people, but this is what I came up with...

pawn Код:
if(strcmp(cmdtext,"/Mask",true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(Mask == 0) return SendClientMessage(playerid, 0xFF6C6CFF, "You don't have a mask!");
        if(IsPlayerInRangeOfPoint(playerid, 1, 1588.2670,-2324.5415,1461.6630))
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                ShowPlayerNameTagForPlayer(i,playerid,0)
                DisableNameTagLOS();
                GameTextForPlayer(playerid, "~W~You have put ~g~ on", 5000, 5);
            }
        }
        else
        {
            return SendClientMessage(playerid, 0xFF6C6CFF, "You are not in the correct area!");
        }
    }
    return 1;
}
Wait... I think this entire code is a bunch of crap. This will not buy the mask, but only put it on when in the area you want...


Re: Very small issue with a script. - Scriptissue - 29.09.2010

PHP код:
error 001expected token";"but found "-identifier-" 
This is the line of the error :
PHP код:
DisableNameTagLOS(); 



Re: Very small issue with a script. - Cameltoe - 29.09.2010

And Mask should be Mask[MAX_PLAYERS]; and Mask[playerid].


Re: Very small issue with a script. - Scriptissue - 29.09.2010

Anyways, can any one help me solving the problem ?