Very small issue with a script.
#1

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;
 } 
Reply
#2

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...
Reply
#3

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

And Mask should be Mask[MAX_PLAYERS]; and Mask[playerid].
Reply
#5

Anyways, can any one help me solving the problem ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)