Your Help.
#1

I'm making a roadblock command but facing some issues with deleting them.

Код:
enum PlayerBlocks
{
	pRoadblock,
}new Player[MAX_PLAYERS][PlayerBlocks];

CMD:roadblock(playerid,params[]) {
      new Float:Pos[4];
      GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
      GetPlayerFacingAngle(playerid, Pos[3]);
      Pos[0] += (3 * floatsin(-Pos[3], degrees));
      Pos[1] += (3 * floatcos(-Pos[3], degrees));
      Player[playerid][PlayerBlocks] = CreateObject(978, Pos[0], Pos[1], Pos[2], 0.0, 0.0, Pos[3]);
      return 1;

CMD:removeall(playerid,params[])
{
  new Float:Pos[4];
  GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  if(IsPlayerInRangeOfPoint(playerid, 100, Pos[0], Pos[1], Pos[2]))
  {
    DestroyObject(PlayerInfo[playerid][PlayerBlocks]);
    
	}
	return 1;
}
Could someone tell me what i should do i was thinking of making a forloop but i wasn't sure of how to do the enum if it was right,thanks.

EDIT: i also wanted a command to remove the nearest roadblock to you but after your help i should know.
Reply


Messages In This Thread
Your Help. - by ISmokezU - 12.10.2016, 00:54
Re: Your Help. - by Kaliber - 12.10.2016, 01:17
Re: Your Help. - by ISmokezU - 12.10.2016, 01:27
Re: Your Help. - by Kaliber - 12.10.2016, 01:37
Re: Your Help. - by ISmokezU - 12.10.2016, 22:37
Re: Your Help. - by Threshold - 13.10.2016, 07:27
Re: Your Help. - by ISmokezU - 13.10.2016, 10:23
Re: Your Help. - by ranme15 - 13.10.2016, 10:30
Re: Your Help. - by Threshold - 13.10.2016, 12:15

Forum Jump:


Users browsing this thread: 1 Guest(s)