12.10.2016, 00:54
I'm making a roadblock command but facing some issues with deleting them.
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.
Код:
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; }
EDIT: i also wanted a command to remove the nearest roadblock to you but after your help i should know.