06.10.2011, 17:06
pawn Код:
//global variables
new bool:Blocked[MAX_PLAYERS];
new roadblock[MAX_PLAYERS];
//commands
if (strcmp(cmd,"/roadblock",true) == 0)
{
if(!Blocked[playerid])
{
new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid,A);
roadblock[playerid] = CreateObject(978, X, Y, Z, 0.0, 0.0, A);
Block[playerid] = true;
return 1;
}
else return SendClientMessage(playerid, -1, "You already create a road block...delete first!");
}
if (strcmp(cmd,"/deleteblock",true) == 0)
{
if(Blocked[playerid])
{
DestroyObject(roadblock[playerid);
Blocked[playerid] = false;
return 1;
}
else return SendClientMessage(playerid, -1, "You dont create any road block!");
}