On player enter checkpoint
#1

Hello ,
can anyone provide a example or explain if i can make it so when a checkpoint in a certain spot is entered and a person is in a car , they type /destroy and the car is removed/destroyed.

I assume someone out there can help.
Reply
#2

Please.
Reply
#3

Код:
[ pawno code]public OnPlayerEnterCheckpoint(playerid)
{
	new string[256];

	switch(getCheckpointType(playerid))
	{


		case CP_HOSPITALin:
			{
			if(GetPlayerVirtualWorld(playerid) == 1) { // LS MARKET
			SetPlayerInterior(playerid,0);
			SetPlayerPos(playerid,1177.1379,-1325.4160,14.0559);
			SendClientMessage(playerid,COLOR_YELLOW,"You have exited All Saints General Hospital.");
			SetPlayerFacingAngle(playerid,271.3165);
			SetPlayerVirtualWorld(playerid,0);
Thats an exapmle of a CP. As for your command, Its impossible to use a cmd on a Cp
Reply
#4

Quote:
Originally Posted by [LSR
State_Trooper ]
Thats an exapmle of a CP. As for your command, Its impossible to use a cmd on a Cp


https://sampwiki.blast.hk/wiki/IsPlayerInCheckpoint

Here is the command for xxjackoxx
pawn Код:
if(strcmp(cmdtext, "/destroy", true)==0)
{
  if(IsPlayerInCheckpoint(playerid))
  {
    if(IsPlayerInAnyVehicle(playerid))
    {
      DestroyVehicle(GetPlayerVehicleID(playerid));
    }
    else
    {
      SendClientMessage(playerid, red, "Error: You need to be in a vehicle to destroy it!");
    }
  }
  else
  {
    SendClientMessage(playerid, red, "Error: You are not in the checkpoint!");
  }
  return 1;
}
Reply
#5

thankyou!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)