All pastes #908729 Raw Edit

Someone

public text v1 · immutable
·published 2008-02-18 18:29 UTC
rendered paste body
//variables
enum blockinfo{
	bool:created,
	id
}
new roadblock[MAX_PLAYERS][MAX_ROADBLOCKS][blockinfo];	


	if(strcmp(cmdtext, "/block", true)==0)
	{
	    if (gTeam[playerid] != 2) return SendClientMessage(playerid, COLOR_GRAD2,"    You're not a cop!");
	    new Float:X, Float:Y, Float:Z, Float:A;
	    GetPlayerPos(playerid, X, Y, Z);
	    GetPlayerFacingAngle(playerid, A);
	    //chenge this
//you must found first free roadblock[playerid][i] add store in it you roadblock
	    roadblock = CreateObject(981, X, Y, Z, 0.0, 0.0, A);
	    RoadBlock[playerid] += 1;
	    SendClientMessage(playerid, COLOR_GRAD2, "RoadBlock Successfully Deployed");
	    return 1;
	}


+++++++++++


	if(strcmp(cmdtext, "/unblock", true)==0)
	{
	    if (gTeam[playerid] != 2) return SendClientMessage(playerid, COLOR_GRAD2,"    You're not a cop!");
	    if (RoadBlock[playerid] == 0) return SendClientMessage(playerid, COLOR_GRAD2,"    You didn't add a roadblock!");
	    //and this for remove what you want =)
	    DestroyObject(roadblock);
	    RoadBlock[playerid] -= 1;
	    SendClientMessage(playerid, COLOR_GRAD2, "RoadBlock Successfully Removed");
	    return 1;
	}