23.05.2009, 22:13
pawn Код:
//change new block; to:
new block[MAX_PLAYERS];
//change commands to:
if(strcmp(cmd, "/roadblock", true) == 0)
{
if(roadblock[playerid] == 0)
if (gTeam[playerid] == 2)
{
new Float:x, Float:y, Float:z, Float:a;
GetPlayerFacingAngle(playerid,a);
GetPlayerPos(playerid, x, y, z);
block[playerid] = CreateStreamObject(981,x,y,z,0.0,0.0,a,200.00);
SendClientMessage(playerid,COLOR_GREY, "You made a roadblock");
roadblock[giveplayerid] = 1;
new Float:slx, Float:sly, Float:slz;
GetPlayerPos(playerid, slx, sly, slz);
SetPlayerPos(playerid, slx, sly, slz+4);
}
else
{
SendClientMessage(playerid, COLOR_RED, "you have all ready made a roadblock (/removeroadblock)");
}
}
else if(strcmp(cmd,"/removeroadblock", true)== 0)
if (gTeam[playerid] == 2)
{
DestroyStreamObject(block[playerid]);
SendClientMessage(playerid,COLOR_GREY, "You removed your roadblock, you can new make a new one");
roadblock[giveplayerid] = 0;
return 1;
}