Szerző Téma: filescriptbõl code  (Megtekintve 648 alkalommal)

filescriptbõl code
« Dátum: 2013. Július 25. - 19:17:59 »
0 Show voters
// By GROVE4L
// www.pawnoscripting.com
#include <a_samp>
#define FILTERSCRIPT
#define COLOR 0xC2A2DAAA
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
forward Velocidad(playerid);
forward Check(playerid);
forward Rojo(playerid);
forward Camara(playerid);
new Timer[MAX_PLAYERS];
new TRojo[MAX_PLAYERS];
new TCamara[MAX_PLAYERS];
new Choque[MAX_PLAYERS];
new Si[MAX_PLAYERS];
new Text: FlashR;
enum Info
{
Manejando,
};
new Informacion[MAX_PLAYERS][info];
public OnPlayerSpawn(playerid)
{
FlashR = TextDrawCreate(1.000000,1.000000,\"_\");
TextDrawTextSize(FlashR,640.000000,10.000000);
TextDrawLetterSize(FlashR,3.600000,47.600010);
TextDrawUseBox(FlashR,1);
TextDrawAlignment(FlashR,0);
TextDrawFont(FlashR,3);
TextDrawSetOutline(FlashR,1);
TextDrawSetProportional(FlashR,1);
TextDrawSetShadow(FlashR,1);
TextDrawBackgroundColor(FlashR,0xD20000FF);
TextDrawColor(FlashR,0xD20000FF);
TextDrawBoxColor(FlashR,0xD20000FF);
Timer[playerid] = SetTimerEx(\"Check\", 100, 1, \"i\", playerid);
Informacion[playerid][Manejando] = 0;
}
public OnPlayerDisconnect(playerid)
{
KillTimer(Timer[playerid]);
    KillTimer(Choque[playerid]);
    Informacion[playerid][Manejando] = 0;
return 1;
}
public Velocidad(playerid)
{
new Float:Vx, Float:Vy, Float:Vz;
if(IsPlayerInAnyVehicle(playerid) && Informacion[playerid][Manejando])
{
GetVehicleVelocity(GetPlayerVehicleID(playerid), Vx, Vy, Vz);
if(Vx > -0.1 && Vx < 0.1 && Vy > -0.1 && Vy < 0.1)
{
    new Float:Vida;
    GetPlayerHealth(playerid, Vida);
    SetPlayerHealth(playerid, Vida-11.0);
    SetPlayerDrunkLevel(playerid, 500000);
    TextDrawShowForPlayer(playerid, FlashR);
    Informacion[playerid][Manejando] = 0;
        new String[256];
   new Nombre[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Nombre,sizeof(Nombre));
          format(String, sizeof(String), \"* %s has been in a collision.\", Nombre);
          ProxDetector(30.0, playerid, String, COLOR,COLOR,COLOR,COLOR,COLOR);
   TRojo[playerid] = SetTimerEx(\"Rojo\", 250, 1, \"i\", playerid);
   TCamara[playerid] = SetTimerEx(\"Camara\", 10000, 1, \"i\", playerid);
}
}
return 1;
}
public Rojo(playerid)
{
TextDrawHideForPlayer(playerid, FlashR);
return 1;
}
public Camara(playerid)
{
KillTimer(TCamara[playerid]);
SetPlayerDrunkLevel(playerid, 0);
return 1;
}
public Check(playerid)
{
new Float:Cx, Float:Cy, Float:Cz;
if(IsPlayerInAnyVehicle(playerid))
{
GetVehicleVelocity(GetPlayerVehicleID(playerid), Cx, Cy, Cz);
if(Cx < -0.4 || Cx > 0.4 || Cy < -0.4 || Cy > 0.4 && !Informacion[playerid][Manejando])
{
    Choque[playerid] = SetTimerEx(\"Velocidad\", 100, 1, \"i\", playerid);
    Informacion[playerid][Manejando] = 1;
}
else
{
    KillTimer(Choque[playerid]);
    Informacion[playerid][Manejando] = 0;
}
}
return 1;
}
 
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i < MAX_PLAYERS; i++)
{
   if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
   {
             if(!Si)
      {
         GetPlayerPos(i, posx, posy, posz);
         tempposx = (oldposx -posx);
         tempposy = (oldposy -posy);
         tempposz = (oldposz -posz);
         if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
         {
            SendClientMessage(i, col1, string);
         }
         else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
         {
            SendClientMessage(i, col2, string);
         }
         else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
         {
            SendClientMessage(i, col3, string);
         }
         else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
         {
            SendClientMessage(i, col4, string);
         }
         else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
         {
            SendClientMessage(i, col5, string);
         }
      }
      else
      {
         SendClientMessage(i, col1, string);
      }
   }
}
}
return 1;
}
// By GROVE4L

 
Hellotok valaki segítene áttenni code-ba?:D
Nagyon megköszönném!

Nem elérhető EnterR

  • Globális moderátor
  • 4223
  • dawg
    • Profil megtekintése
filescriptbõl code
« Válasz #1 Dátum: 2013. Július 25. - 20:08:00 »
0 Show voters
Milyen kódba? Nem értem a kérdést.

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
filescriptbõl code
« Válasz #2 Dátum: 2013. Július 25. - 21:09:07 »
0 Show voters
Ez szerintem AntiDeAMX -el lett konvertálva.. vagyis én úgy nézem  ::|

filescriptbõl code
« Válasz #3 Dátum: 2013. Július 25. - 21:31:05 »
0 Show voters
úgy szeretném hogy betudjam rakni gamemodba!:Dû
mert sok fs-m van,és bele akarom õket írni a móba

Nem elérhető JBauer

  • 1407
    • Profil megtekintése
filescriptbõl code
« Válasz #4 Dátum: 2013. Július 25. - 23:25:49 »
0 Show voters
Idézetet írta: ZyZu date=1374779347\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"40435\" data-ipsquote-contentclass=\"forums_Topic
Ez szerintem AntiDeAMX -el lett konvertálva.. vagyis én úgy nézem  ::|
 
Szemüveg.. Akkor Float: var0.0 stb.. lenne.

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
filescriptbõl code
« Válasz #5 Dátum: 2013. Július 25. - 23:35:53 »
0 Show voters
Idézetet írta: JBauer date=1374787549\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"40435\" data-ipsquote-contentclass=\"forums_Topic


Ez szerintem AntiDeAMX -el lett konvertálva.. vagyis én úgy nézem  ::|
 
Szemüveg.. Akkor Float: var0.0 stb.. lenne.
 
[/quote]
Tudtam, hogy van benne olyan azért kérdeztem, egyébként erre figyeltem be..
 
col1,col2,col3,col4,col5

 
azért kérdeztem rá. :D

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
filescriptbõl code
« Válasz #6 Dátum: 2013. Július 26. - 11:05:51 »
0 Show voters
Hát akkor meg? Ezeket írd a mód elejére

#define COLOR 0xC2A2DAAA
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
forward Velocidad(playerid);
forward Check(playerid);
forward Rojo(playerid);
forward Camara(playerid);
 
new Timer[MAX_PLAYERS];
new TRojo[MAX_PLAYERS];
new TCamara[MAX_PLAYERS];
new Choque[MAX_PLAYERS];
new Si[MAX_PLAYERS];
new Text: FlashR;
enum Info
{
        Manejando,
};

 
Ezt pedig a public OnPlayerSpawn(playerid) alá
 

public OnPlayerSpawn(playerid)
{
        FlashR = TextDrawCreate(1.000000,1.000000,\"_\");
        TextDrawTextSize(FlashR,640.000000,10.000000);
        TextDrawLetterSize(FlashR,3.600000,47.600010);
        TextDrawUseBox(FlashR,1);
        TextDrawAlignment(FlashR,0);
        TextDrawFont(FlashR,3);
        TextDrawSetOutline(FlashR,1);
        TextDrawSetProportional(FlashR,1);
        TextDrawSetShadow(FlashR,1);
        TextDrawBackgroundColor(FlashR,0xD20000FF);
        TextDrawColor(FlashR,0xD20000FF);
        TextDrawBoxColor(FlashR,0xD20000FF);
        Timer[playerid] = SetTimerEx(\"Check\", 100, 1, \"i\", playerid);
        Informacion[playerid][Manejando] = 0;
}

 
EZt pedog a public OnPlayerDisconnect(playerid) alá
 
        KillTimer(Timer[playerid]);
    KillTimer(Choque[playerid]);
    Informacion[playerid][Manejando] = 0;
        return 1;
}

 És így tovább
[mod]Máskor CODE tagek![/mod]
« Utoljára szerkesztve: 2013. Július 26. - 11:20:31 írta Benceee »

filescriptbõl code
« Válasz #7 Dátum: 2013. Július 26. - 17:27:42 »
0 Show voters
Nagyon köszönöm mindenki válaszát!

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal