Szerző Téma: KézFelrakás  (Megtekintve 1382 alkalommal)

Nem elérhető JackBronson

  • 1499
  • ??
    • Profil megtekintése
KézFelrakás
« Dátum: 2012. Augusztus 25. - 13:14:50 »
+3 Show voters
Hellósztok ezt a scriptet a teszt RP szerómra irtam de nem kell nekem.
Ennek a scriptnek csak annyi a lényege,hogy ha megnyomja a NUm padon a 4-es gombot akkro felteszi a kezét és aki a közelbe van annakki is írja,hogy \"Valaki lassan felemeli a kezét\"
10 mp csak 1x-er lehet használni.
A lényege csak az,hogy ha pl ki rabolnak vagy valami ne keljen beirni /hendsup hanem megnyomod a 4-es és fel is teszi a kezét.
Nem nagy cucc de hátha valakinek jó lesz.
Természetesen nem loptam én készitettem vagyis JaCK
elkészitési idõ : 5 perc
Itt a kod.
 

//Kéz felrakása a NUM padon a 4-es gombal by JaCK
#include <a_samp>
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_PINK 0xC2A2DAAA
#define B_Cselekves 20.0
 
//Fügvények
new feltenni[MAX_PLAYERS];
new BigEar[MAX_PLAYERS];
new gPlayerUsingLoopingAnim[MAX_PLAYERS];
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
forward ProxDetectorS(Float:radi, playerid, targetid);
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
 
#define KEZET_FEL 1
#define KEZET_LE 0
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Csatlakozás\");
print(\"--------------------------------------\\n\");
 
 
 

return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print(\"\\n----------------------------------\");
print(\" Lecsatlakozás\");
print(\"----------------------------------\\n\");
}
#endif
 
public OnPlayerSpawn(playerid)
{
feltenni[playerid] = KEZET_FEL;//Ha le spawnol akkor természetesen majd felteheti a kezét.
return 1;
}
 
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(feltenni[playerid] == KEZET_FEL)//Ha az érték KEZET_FEL akkor lekérdezi a parancssort
{
if(newkeys == KEY_ANALOG_LEFT) //NUM pad 4
{
    new string[64];
    format(string, sizeof(string), \"* Valaki felemeli a kezét szép lassan\");//Aki a közelbe lesz a játékosnak annak kiirja ezt a szöveget.
    //ChatLog(string);
    feltenni[playerid] = KEZET_LE;
    SetTimerEx(\"kezetfell\",10000, 0, \"i\", playerid);//Elinditounk egy timert-hogy mikor használhassa újra
    ProxDetector(B_Cselekves, playerid, string, COLOR_PINK,COLOR_PINK,COLOR_PINK,COLOR_PINK,COLOR_PINK);
LoopingAnim(playerid, \"ROB_BANK\",\"SHP_HandsUp_Scr\", 4.0, 0, 1, 1, 1, 0);
 
}
}
if(feltenni[playerid] == KEZET_LE)//DE ha a KEZET_LE akkor a fügvény nem teljesül
{
if(newkeys == KEY_ANALOG_LEFT)
{
SendClientMessage(playerid,COLOR_LIGHTRED,\"CossRPG: Mivel használtad a kezed most várnod kell: 10 mp :( \");
}
}
 

    return 1;
}
forward kezetfell(playerid);
public kezetfell(playerid)
{
feltenni[playerid] = KEZET_FEL;//újra engedélyezzük a kézfelrakást
SendClientMessage(playerid,COLOR_LIGHTRED,\"CossRPG: Újra felteheted a kezed\");
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);
//radi = 2.0; //Trigger Radius
for(new i = 0; i < MAX_PLAYERS; i++)
{
   if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
   {
      if(!BigEar)
      {
         GetPlayerPos(i, posx, posy, posz);
         tempposx = (oldposx -posx);
         tempposy = (oldposy -posy);
         tempposz = (oldposz -posz);
         //printf(\"DEBUG: X:%f Y:%f Z:%f\",posx,posy,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;
}
public ProxDetectorS(Float:radi, playerid, targetid)
{
    if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
{
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);
//radi = 2.0; //Trigger Radius
GetPlayerPos(targetid, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
//printf(\"DEBUG: X:%f Y:%f Z:%f\",posx,posy,posz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
   return 1;
}
}
return 0;
}
LoopingAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, lockz, lp)
{
    gPlayerUsingLoopingAnim[playerid] = 1;
    ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, lockz, lp);
}

 
AMX:
http://www.solidfiles.com/d/78efe32620/

Nem elérhető instant

  • 2778
  • ZzzzzZ
    • Profil megtekintése
KézFelrakás
« Válasz #1 Dátum: 2012. Augusztus 25. - 22:05:40 »
0 Show voters
SendClientMessage(playerid,COLOR_LIGHTRED,\"CossRPG: Újra felteheted a kezed\");[/quote]
befigyel :D , szép munka

KézFelrakás
« Válasz #2 Dátum: 2012. Augusztus 25. - 22:21:59 »
0 Show voters
Jo kis szkript!Ment a +!  ;) :D

KézFelrakás
« Válasz #3 Dátum: 2012. Augusztus 25. - 22:42:27 »
0 Show voters
Szép script,csak így tovább!

Nem elérhető JackBronson

  • 1499
  • ??
    • Profil megtekintése
KézFelrakás
« Válasz #4 Dátum: 2012. Augusztus 26. - 14:09:29 »
0 Show voters
Idézetet írta: ZzzzzZ date=1345925140\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"26838\" data-ipsquote-contentclass=\"forums_Topic

SendClientMessage(playerid,COLOR_LIGHTRED,\"CossRPG: Újra felteheted a kezed\");
befigyel :D , szép munka
 
[/quote]
Igen XD mivel irtam, hogy a RP szerómon volt :D
Megnézheted ha akarod :)

Rammstein

  • Vendég
KézFelrakás
« Válasz #5 Dátum: 2012. Augusztus 26. - 16:31:52 »
0 Show voters
BlackJack\" post=\"333763\" timestamp=\"1345926119\"]
Jo kis szkript!Ment a +!  ;) :D
 
[/quote]
kipróbáltad?

Nem elérhető JackBronson

  • 1499
  • ??
    • Profil megtekintése
KézFelrakás
« Válasz #6 Dátum: 2012. Augusztus 26. - 17:38:26 »
0 Show voters
Idézetet írta: Stuntzor シ date=1345991512\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"26838\" data-ipsquote-contentclass=\"forums_Topic

BlackJack link=topic=31322.msg333763#msg333763 date=1345926119]
Jo kis szkript!Ment a +!  ;) :D
 
kipróbáltad?
 
[/quote]
Ha arra célzól,hogy tesztelve van akkor igen.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal