Falls du GF benutzt:
ganz oben im Script:
new Sperrebit[MAX_PLAYERS];
new Sperre[MAX_PLAYERS][5];
if (strcmp( cmdtext,"/adminrb", true )==0)
{
if(Sperrebit[playerid]==0)
{
if(PlayerInfo[playerid][pAdmin] == 1)
if(!IsPlayerInAnyVehicle(playerid))
{
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
GetXYInFrontOfPlayer(playerid,x,y,2.0);
Sperre[playerid][0] = CreateObject(981,x,y,z-0.5,0,0,a+180);
/*Sperre[playerid][1] = CreateObject(1228,x+2.0 * floatsin(-a+90, degrees),y+2.0 * floatcos(-a+90, degrees),z-0.5,0,0,a+90);
Sperre[playerid][2] = CreateObject(1228,x+4.0 * floatsin(-a+90, degrees),y+4.0 * floatcos(-a+90, degrees),z-0.5,0,0,a+90);
Sperre[playerid][3] = CreateObject(1228,x-2.0 * floatsin(-a+90, degrees),y-2.0 * floatcos(-a+90, degrees),z-0.5,0,0,a+90);
Sperre[playerid][4] = CreateObject(1228,x-4.0 * floatsin(-a+90, degrees),y-4.0 * floatcos(-a+90, degrees),z-0.5,0,0,a+90);*/
Sperrebit[playerid]=20;
SendClientMessage(playerid, COLOR_YELLOW,"AdminRoadBlock aufgebaut.");
} else {
SendClientMessage(playerid, COLOR_RED,"Du kannst keine Straßensperre erstellen wenn du in einem Auto bist!");
}
} else {
DestroyObject(Sperre[playerid][0]);
/*DestroyObject(Sperre[playerid][1]);
DestroyObject(Sperre[playerid][2]);
DestroyObject(Sperre[playerid][3]);
DestroyObject(Sperre[playerid][4]);*/
Sperrebit[playerid]=0;
SendClientMessage(playerid, COLOR_YELLOW,"AdminRoadBlock abgebaut.");
}
return 1;
}
Ungetestet.