Advertisement
Guest User

Mr.R/radeh2

a guest
Feb 10th, 2015
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.92 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf>
  4.  
  5. new checker;
  6. enum pdatas {
  7.     Float:pPosX,
  8.     Float:pPosY,
  9.     Float:pPosZ,
  10.     Float:pPosA,
  11.     pInCar,
  12.     pCar,
  13.     pSeat,
  14.     pVW,
  15.     pInt,
  16.     pWeapon[13],
  17.     pAmmo[13],
  18.     timers0b
  19. };
  20. new pData[MAX_PLAYERS][pdatas];
  21. AntyDeAMX()
  22. {
  23.         new amx[][] ={"Unarmed (Fist)","Brass K"};
  24.         new d;
  25.         #emit load.pri d
  26.         #emit stor.pri d
  27.         #pragma unused amx
  28. }
  29. public OnFilterScriptInit()
  30. {
  31.         AntyDeAMX();
  32.         print("--- Anty s0beit checker by radeh/Mr.R || CMD:/chech [id] |[ALPHA] --- ");
  33.         return 1;
  34. }
  35.  
  36. CMD:check(playerid, params[]){
  37.     new pID;
  38.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1,"Komenda tylko dla administratora!");
  39.     if(sscanf(params, "i", pID)) return SendClientMessage(playerid, -1,"/check [id]");
  40.     if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, -1,"Gracz nie jest podlaczony");
  41.     checker = playerid;
  42.     if(!IsPlayerInAnyVehicle(pID)){
  43.         GetPlayerPos(pID, pData[pID][pPosX],pData[pID][pPosY],pData[pID][pPosZ]);
  44.         GetPlayerFacingAngle(pID, pData[pID][pPosA]);
  45.         pData[pID][pVW] = GetPlayerVirtualWorld(pID);
  46.         pData[pID][pInt] = GetPlayerInterior(pID);
  47.         pData[pID][pInCar] = 0;
  48.         for (new i = 0; i <= 12; i++)
  49.         {
  50.             GetPlayerWeaponData(pID, i, pData[pID][pWeapon][i] ,pData[pID][pAmmo][i] );
  51.         }
  52.     }else{
  53.         GetPlayerPos(pID, pData[pID][pPosX],pData[pID][pPosY],pData[pID][pPosZ]);
  54.         GetPlayerFacingAngle(pID, pData[pID][pPosA]);
  55.         pData[pID][pVW] = GetPlayerVirtualWorld(pID);
  56.         pData[pID][pInt] = GetPlayerInterior(pID);
  57.         pData[pID][pCar] = GetPlayerVehicleID(pID);
  58.         pData[pID][pSeat] = GetPlayerVehicleSeat(pID);
  59.         pData[pID][pInCar] = 1;
  60.         RemovePlayerFromVehicle(pID);
  61.         for (new i = 0; i <= 12; i++)
  62.         {
  63.             GetPlayerWeaponData(pID, i, pData[pID][pWeapon][i] ,pData[pID][pAmmo][i] );
  64.         }      
  65.     }
  66.     CheckS0beit(pID);  
  67.  
  68.     return 1;
  69. }
  70. public OnPlayerDisconnect(playerid){
  71.     KillTimer(pData[playerid][timers0b]);
  72.     return 1;
  73. }
  74. forward AntiS0bek(pID);
  75. public AntiS0bek(pID){
  76.     new dt[2];
  77.     GetPlayerWeaponData(pID, WEAPON_GOLFCLUB-1, dt[0], dt[1]);
  78.     if(dt[0] == WEAPON_GOLFCLUB){
  79.         new strr[64], name[MAX_PLAYER_NAME];
  80.         GetPlayerName(pID, name, MAX_PLAYER_NAME);
  81.         format(strr,sizeof(strr),"Gracz %s(%d) uzywa s0beita i zostanie wyrzucony!",name,pID);
  82.         SendClientMessage(checker, -1, strr);
  83.         Kick(pID);
  84.     }else{
  85.         new strr[64], name[MAX_PLAYER_NAME];
  86.         GetPlayerName(pID, name, MAX_PLAYER_NAME);
  87.         format(strr,sizeof(strr),"Gracz %s(%d) nie uzywa s0beita!",name,pID);
  88.         SendClientMessage(checker, -1, strr);
  89.         if(pData[pID][pInCar] == 0){
  90.             SetPlayerVirtualWorld(pID, pData[pID][pVW]);
  91.             SetPlayerInterior(pID, pData[pID][pInt]);
  92.             SetPlayerPos(pID, pData[pID][pPosX],pData[pID][pPosY],pData[pID][pPosZ]);
  93.             SetPlayerFacingAngle(pID, pData[pID][pPosA]);
  94.             ResetPlayerWeapons(pID);
  95.             for (new i = 0; i <= 12; i++)
  96.             {
  97.                 GivePlayerWeapon(pID,pData[pID][pWeapon][i],pData[pID][pAmmo][i]);
  98.             }
  99.         }else{
  100.             SetPlayerVirtualWorld(pID, pData[pID][pVW]);
  101.             SetPlayerInterior(pID, pData[pID][pInt]);
  102.             //SetPlayerPos(pID, pData[pID][pPosX],pData[pID][pPosY],pData[pID][pPosZ]);
  103.             //SetPlayerFacingAngle(pID, pData[pID][pPosA]);
  104.             PutPlayerInVehicle(pID, pData[pID][pCar], pData[pID][pSeat]);
  105.             ResetPlayerWeapons(pID);
  106.             for (new i = 0; i <= 12; i++)
  107.             {
  108.                 GivePlayerWeapon(pID,pData[pID][pWeapon][i],pData[pID][pAmmo][i]);
  109.             }      
  110.         }          
  111.     }
  112.     checker = -1;
  113.     return 1;
  114. }
  115.  
  116. stock CheckS0beit(playerid){
  117.     new c[MAX_PLAYERS];
  118.     SetPlayerVirtualWorld(playerid, 100+playerid);
  119.     ResetPlayerWeapons(playerid);
  120.     c[playerid] = CreateVehicle(457, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
  121.     SetVehicleVirtualWorld(c[playerid], 100+playerid);
  122.     PutPlayerInVehicle(playerid, c[playerid], 0);
  123.     RemovePlayerFromVehicle(playerid);
  124.     DestroyVehicle(c[playerid]);
  125.     SetPlayerPos(playerid, 0.0, 0.0, 10000.0);
  126.     pData[playerid][timers0b] = SetTimerEx("AntiS0bek", 1000, false, "i", playerid);
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement