#include stock Float:GetAngleXlen(Float:Angle, Float:Hyplen) { return -floatcos(90 - Angle, degrees) * Hyplen; } stock Float:GetAngleYlen(Float:Angle, Float:Hyplen) { return floatsin(90 - Angle, degrees) * Hyplen; } stock GetDistance(Float:xPos, Float:xPos2, Float:yPos, Float:yPos2) { new Float:dist = floatabs(floatsqroot(floatpower(xPos - xPos2, 2) + floatpower(yPos - yPos2, 2))); return floatround(dist); } stock IsPlayerInCircle(playerid, Float:xPos, Float:yPos, Float:radius) { new Float:PPos[3]; GetPlayerPos(playerid, PPos[0], PPos[1], PPos[2]); if (GetDistance(xPos, PPos[0], yPos, PPos[1]) < radius) return true; return false; } #define slots 30 //------------------------------ new bool:block[slots] = true ; new block1[slots]; new block2[slots]; new block3[slots]; new block4[slots]; new block5[slots]; new skins[12] = {24,287,288,285,284,283,282,281,280,279,278,277}; #define FILTERSCRIPT #if defined FILTERSCRIPT public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Blockade For Live SA:MP (c) by NatKingCole"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { for (new i = 0; i < sizeof(skins); i++) { if(GetPlayerSkin(playerid) == skins[i] ) { if(block[playerid] == true ) { if (strcmp("/block", cmdtext, true, 10) == 0) { new Float:posx , Float:posy ,Float:posz ,Float:face1 ; GetPlayerPos(playerid, posx,posy,posz); GetPlayerFacingAngle(playerid,face1); block1[playerid] = CreateObject(1228,posx+GetAngleXlen(face1,2.0),posy+GetAngleYlen(face1,2.0),posz-1.5,0,0,face1); block2[playerid] = CreateObject(1228,posx+GetAngleXlen(face1,4.0),posy+GetAngleYlen(face1,4.0),posz-1.5,0,0,face1); block3[playerid] = CreateObject(1228,posx+GetAngleXlen(face1,6.0),posy+GetAngleYlen(face1,6.0),posz-1.5,0,0,face1);//mitte block4[playerid] = CreateObject(1228,posx+GetAngleXlen(face1,8.0),posy+GetAngleYlen(face1,8.0),posz-1.5,0,0,face1); block5[playerid] = CreateObject(1228,posx+GetAngleXlen(face1,10.0),posy+GetAngleYlen(face1,10.0),posz-1.5,0,0,face1); block[playerid] = false; return 1; } } if(block[playerid] == false ) { if (strcmp("/block", cmdtext, true, 10) == 0) { DestroyObject(block1[playerid]); DestroyObject(block2[playerid]); DestroyObject(block3[playerid]); DestroyObject(block4[playerid]); DestroyObject(block5[playerid]); block[playerid] = true ; return 1; } } } } return 0; } public OnPlayerDisconnect(playerid) { DestroyObject(block1[playerid]); DestroyObject(block2[playerid]); DestroyObject(block3[playerid]); DestroyObject(block4[playerid]); DestroyObject(block5[playerid]); }