Why wont this code work???
#1

Код:
		if(!strcmp(cmdtext,"/stealfuel",true))
        {
        if (IsPlayerInCheckpoint(playerid))
        if(waitstealfuel[playerid] == true)
		{
		SendClientMessage(playerid, RED, "[ATT]:Wait Before Stealing Fuel Again!");
		}
		else if(canstealfuel[playerid] == true)
  		{
		    if(stealfuel[playerid] == false)
			{
                new str[128];
                GetPlayerName(playerid, str, sizeof(str));
                format(str, sizeof(str), "[ATT]:%s Is Attemping To Steal Fuel Right Now!", str, cmdtext[4]);
                SendClientMessageToAll(RED, str);
				GameTextForPlayer(playerid, "~w~Stealing Fuel ~r~Please Wait!",10000,5);
				timer1 = SetTimerEx("steal", 10000, false, "d", playerid);
				stealfuel[playerid] = true;
			}
			else
			{
			SendClientMessage(playerid, RED, "[ATT]:You Are Already Stealing Fuel!");
			}
		}
		else
		{
		SendClientMessage(playerid, RED, "[ATT]:You Need To Be In The Checkpoint To Steal Fuel!");
		}
		return 1;
	    }
It should tell them thay have to be in checkpoint when thay /stealfuel anywhere other then the checkpoint..But it isnt?What am i doing wrong? Everything else works fine..
Reply
#2

Use IsPlayerInCheckpoint.
Reply
#3

Quote:
Originally Posted by Whizion
Посмотреть сообщение
Use IsPlayerInCheckpoint.
I have the rest works fine just it dont say anything when u /stealfuel anywhere but the checkpoints..
Reply
#4

I'd suggest using the IsPlayerInRangeOfPoint function. Get the cords at the point of the cp and then track if there at the point

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)