Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <streamer>
- #include <zcmd>
- #define FILTERSCRIPT
- enum KoralInfo
- {
- koral,
- kveh,
- _kZone,
- _kObj,
- Float:kObjX,
- Float:kObjY,
- Float:kObjZ,
- kID,
- Float:_vehX,
- Float:_vehY,
- Float:_vehZ
- }
- new kInfo[10][KoralInfo];
- public OnFilterScriptInit()
- {
- SetTimer("CheckPlayers",1000,true);
- for(new i=0;i<10;i++)
- {
- kInfo[i][kveh] = -1;
- kInfo[i][_kZone] = -1;
- kInfo[i][_kObj] = -1;
- }
- }
- CMD:kspawn(playerid)
- {
- new _v = GetFreeVeh();
- if(_v == -1) return SendClientMessage(playerid,-1,"Daha Fazla Ekliyemezsin");
- else
- {
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- kInfo[_v][kveh] = CreateVehicle(578,x,y,z,9.647,61,61,-1);
- kInfo[_v][koral] = CreateDynamicObject(934,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
- SetDynamicObjectMaterial(kInfo[_v][koral], 0, 7985, "vgsswarehse02c", "muddywater", 0);
- AttachDynamicObjectToVehicle(kInfo[_v][koral], kInfo[_v][kveh], 0.920, -3.190, 0.980, 0.000, 0.000, 0.000);
- kInfo[_v][koral] = CreateDynamicObject(920,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
- AttachDynamicObjectToVehicle(kInfo[_v][koral], kInfo[_v][kveh], 1.040, -4.190, 2.030, 0.000, 0.000, 0.000);
- kInfo[_v][koral] = CreateDynamicObject(3267,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
- AttachDynamicObjectToVehicle(kInfo[_v][koral], kInfo[_v][kveh], 0.330, 0.911, -0.710, 0.000, 0.000, 90.000);
- kInfo[_v][koral] = CreateDynamicObject(2192,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
- AttachDynamicObjectToVehicle(kInfo[_v][koral], kInfo[_v][kveh], -1.291, -5.033, 2.010, 0.000, 0.000, 480.000);
- kInfo[_v][koral] = CreateDynamicObject(3795,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
- AttachDynamicObjectToVehicle(kInfo[_v][koral], kInfo[_v][kveh], -0.720, -2.371, -0.200, 0.000, 0.000, 90.000);
- kInfo[_v][koral] = CreateDynamicObject(2886,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
- AttachDynamicObjectToVehicle(kInfo[_v][koral], kInfo[_v][kveh], 1.130, -4.470, 0.820, 0.000, 0.000, 0.000);
- kInfo[_v][koral] = CreateDynamicObject(2888,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
- AttachDynamicObjectToVehicle(kInfo[_v][koral], kInfo[_v][kveh], -0.710, -5.613, 0.739, 270.000, 0.000, 0.000);
- kInfo[_v][koral] = CreateDynamicObject(19482,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
- SetDynamicObjectMaterialText(kInfo[_v][koral], 0, "<", 60, "Webdings", 45, 0, -65536, 0, 0);
- AttachDynamicObjectToVehicle(kInfo[_v][koral], kInfo[_v][kveh], 1.571, -1.830, -0.040, 0.000, 0.000, 0.000);
- kInfo[_v][koral] = CreateDynamicObject(19482,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
- SetDynamicObjectMaterialText(kInfo[_v][koral], 0, "Z", 130, "Wingdings", 55, 0, -1, 0, 0);
- AttachDynamicObjectToVehicle(kInfo[_v][koral], kInfo[_v][kveh], 1.581, -1.151, -0.220, 0.000, 0.000, 0.000);
- kInfo[_v][koral] = CreateDynamicObject(19482,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
- SetDynamicObjectMaterialText(kInfo[_v][koral], 0, "<", 60, "Webdings", 45, 0, -65536, 0, 0);
- AttachDynamicObjectToVehicle(kInfo[_v][koral], kInfo[_v][kveh], -1.911, 4.517, -1.090, 0.000, 0.000, 90.000);
- kInfo[_v][koral] = CreateDynamicObject(19482,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
- SetDynamicObjectMaterialText(kInfo[_v][koral], 0, "Z", 130, "Wingdings", 55, 0, -1, 0, 0);
- AttachDynamicObjectToVehicle(kInfo[_v][koral], kInfo[_v][kveh], -2.591, 4.529, -1.280, 0.000, 0.000, 90.000);
- kInfo[_v][koral] = CreateDynamicObject(920,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
- AttachDynamicObjectToVehicle(kInfo[_v][koral], kInfo[_v][kveh], -0.990, -0.360, 0.130, 0.000, 0.000, 270.000);
- }
- return 1;
- }
- CMD:ksil(playerid)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- new _v = GetCurrentVeh(playerid);
- if(_v == -1) return SendClientMessage(playerid,-1,"Silmek İstediginiz Araca Binin");
- else
- {
- DestroyObject(kInfo[_v][koral]);
- DestroyVehicle(kInfo[_v][kveh]);
- GangZoneDestroy(kInfo[_v][_kZone]);
- DestroyObject(kInfo[_v][_kObj]);
- kInfo[_v][_kZone] = -1;
- new _text[50];
- format(_text,sizeof(_text),"%d Id'li Araç Silindi",_v);
- SendClientMessage(playerid,-1,_text);
- kInfo[_v][kveh] = -1;
- }
- }
- return 1;
- }
- CMD:kkur(playerid)
- {
- new _v = GetCurrentVeh(playerid);
- if(_v == -1) return SendClientMessage(playerid,-1,"Kurmak İçin Araca Binin");
- else
- {
- if(kInfo[_v][_kZone] > -1) SendClientMessage(playerid,-1,"Araç Zaten Konumladırılmış");
- else
- {
- new Float:_x,Float:_y,Float:_z;
- GetPlayerPos(playerid,_x,_y,_z);
- kInfo[_v][_kZone] = GangZoneCreate(_x-150,_y-150,_x+150,_y+150);
- GangZoneShowForAll(kInfo[_v][_kZone],0x047A1888);
- GameTextForPlayer(playerid,"~g~Askeri Arac Konumlandirildi",1000,4);
- SetVehicleParamsEx(kInfo[_v][kveh],0,0,0,0,0,0,0);
- kInfo[_v][_vehX] = _x,
- kInfo[_v][_vehY] = _y,
- kInfo[_v][_vehZ] = _z;
- }
- }
- return 1;
- }
- CMD:kkaldir(playerid)
- {
- new _v = GetCurrentVeh(playerid);
- if(_v == -1) return SendClientMessage(playerid,-1,"Kaldirmak İçin Araca Binin");
- else
- {
- if(kInfo[_v][_kZone] == -1) SendClientMessage(playerid,-1,"Askeri Araç Henüz Konumlandırılmamış");
- else
- {
- SetVehicleParamsEx(kInfo[_v][kveh],1,0,0,0,0,0,0);
- GangZoneDestroy(kInfo[_v][_kZone]);
- kInfo[_v][_kZone] = -1;
- }
- }
- return 1;
- }
- CMD:v(playerid,params[])
- {
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- CreateVehicle(strval(params),x+1,y,z,0,0,0,-1,0);
- }
- public OnObjectMoved(objectid)
- {
- new _ID = GetObjOwn(objectid);
- if(_ID != -1)
- {
- CreateExplosion(kInfo[_ID][kObjX],kInfo[_ID][kObjY],kInfo[_ID][kObjZ],0,1000);
- DestroyObject(objectid);
- PlayerPlaySound(kInfo[_ID][kID],0,0,0,0);
- kInfo[_ID][_kObj] = -1;
- }
- return 1;
- }
- forward CheckPlayers();
- public CheckPlayers()
- {
- new Float:x,Float:y,Float:z;
- for(new vehicles=0;vehicles<10;vehicles++)
- {
- if(kInfo[vehicles][_kZone] == -1) continue;
- else
- {
- if(kInfo[vehicles][_kObj] == -1)
- {
- for(new i=GetPlayerPoolSize();i!=-1;i--)
- {
- if(!IsPlayerConnected(i)) continue;
- else
- {
- GetPlayerPos(i,x,y,z);
- if((x > kInfo[vehicles][_vehX]-150 && x < kInfo[vehicles][_vehX]+150 && y > kInfo[vehicles][_vehY]-150 && y < kInfo[vehicles][_vehY]+150) && z > kInfo[vehicles][_vehZ]+40)
- {
- kInfo[vehicles][_kObj] = CreateObject(345,kInfo[vehicles][_vehX],kInfo[vehicles][_vehY],kInfo[vehicles][_vehZ],0,0,0,3000);
- PlayerPlaySound(i,30600,0,0,0);
- kInfo[vehicles][kObjX] = x;
- kInfo[vehicles][kObjY] = y;
- kInfo[vehicles][kObjZ] = z;
- MoveObject(kInfo[vehicles][_kObj],x,y,z,5000.0,0,0,0);
- kInfo[vehicles][kID] = i;
- break;
- }
- }
- }
- }
- }
- }
- }
- stock GetFreeVeh()
- {
- for(new i=0;i<10;i++)
- {
- if(kInfo[i][kveh] == -1)
- {
- return i;
- }
- }
- return -1;
- }
- stock GetCurrentVeh(playerid)
- {
- new _vID = GetPlayerVehicleID(playerid);
- for(new i=0;i<10;i++)
- {
- if(_vID == kInfo[i][kveh])
- {
- return i;
- }
- }
- return -1;
- }
- stock GetObjOwn(objectid)
- {
- for(new i=0;i<10;i++)
- {
- if(kInfo[i][_kObj] == objectid) return i;
- }
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement