Jump to content

Funkce SetPlayerFightingStyle & příkaz /styl


_NosiK_

Recommended Posts

Takže dnes vám tu přináším TuT a jeden mini FS který bude do 2 hodin.

Tato funkce je na bojový styl a je velmi lehká

Použití této funkce v gta je PTM + Enter / F

Ale toto sou jen keci kolem funkce tak se na ni vrhneme.


 

SetPlayerFightingStyle(playerid, Style);

NastavHráčiBojovýStyl

playerid - kterému hráči

Styl - styl boje Styly máte dole

GetPlayerFightingStyle(playerid);

ZjistiHráčiBojovéUmění

playerid - kterému hráči


Styl

1. Box

2. Kung fu

3. Knee Head

4. Grab & Kick

5. Elbow

6. Normal ( jako LTM )


Využití - Příkaz

Mezi definice:

#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define B_O 0xFF6600FF 
#define B_Z 0x229315FF
#define B_ZFP 0xC6DE38AA

 

Do OnPlayerCommandText:

dcmd(styl, 4, cmdtext);

 

Někam mimo public:

dcmd_styl(playerid, params[] ) { //otevre nám příkaz
if(!strlen(params)) { // pokud nezadal styl
SCM(playerid, B_O, "==== Bojový Styl ===="); // text
SCM(playerid, B_ZFP, "1. Boxing");
SCM(playerid, B_Z, "2. Kung fu");
SCM(playerid, B_ZFP, "3. Knee Head");
SCM(playerid, B_Z, "4. Grab and Kick");
SCM(playerid, B_ZFP, "5. Elbow");
SCM(playerid, B_Z, "6. Normal");
}else{//opak ze nechybí
if(strcmp("Boxing", params, true, 10) == 0 ) // pokud zadal Boxing styl
{
SendClientMessage(playerid, B_ZFP, "nastavil jste si boxing");
SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING); // nastavímu styl
}
else if(strcmp("Kung fu",params, true, 10) == 0 ) // kung fu
{
SendClientMessage(playerid, B_ZFP, "nastavil jste si kung-fu");
SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU); //nastavení kungfu a dolů
}
else if(strcmp("Knee Head", params, true, 10) == 0 )
{
SendClientMessage(playerid, B_ZFP, "nastavil jste si knee head");
SetPlayerFightingStyle(playerid, FIGHT_STYLE_KNEEHEAD);
}
else if(strcmp("Grab and Kick",params, true, 10) == 0 )
{
SendClientMessage(playerid, B_ZFP, "nastavil jste si Grab and Kick");
SetPlayerFightingStyle(playerid, FIGHT_STYLE_GRABKICK);
}
else if(strcmp("Elbow", params, true, 10) == 0 )
{
SendClientMessage(playerid, B_ZFP, "nastavil jste si Elbow");
SetPlayerFightingStyle(playerid, FIGHT_STYLE_ELBOW);
}
else if(strcmp("Normal",params, true, 10) == 0 )
{
SendClientMessage(playerid, B_ZFP, "nastavil jste si normal");
SetPlayerFightingStyle(playerid, FIGHT_STYLE_NORMAL);
}//ukonceni normal
}// ukonceni strlen
return 1; // return prikazu
}//ukonceni prikazu


Je to všechno

všechny bugy napište, hodnoťte a :spam:

Link to comment
Share on other sites

0/10

dalši tut na ctrl + c & ctrl + v

 

čo chceš popísať na funkcii

SetPlayerFightingStyle ?

SetPlayerFightingStyle(playerid,style);

funkcia

id hráča ktorému to chceme dať

štýl boja

Link to comment
Share on other sites

jak nekdo ma zjistit FIGHT_STYLE_BOXING kdyz je definovany v a_players a nni to po 1, 2, 3

 

a příkaz je 100% muj a je z mojeho modu + takovej tut tady neni a někdo nevi jak to použit, že si profesionalni pawner tak neznamena že někdo nemuže napsat na snadnou funkci tut

Link to comment
Share on other sites

Další prace bez významu...jak říka QWER co chces na tehle funkci vysvětlit ? naprosto primitivní funkce a když už děláš TuT(da-li se to tak nazvat) tak bych aspon definoval vse co tam ma byt...takze jelikoz si skracujes funkci SendClientMessage na SCM tak aspon nahore napisu

#define SCM SendClientMessage

jelikoz tento tut pomuže max novačkum a ty se budou ptat proč jim to hazi undefined symbol SCM.. 0/10 hodnocení

Link to comment
Share on other sites

2/10 (Za snahu) - Toto si každý urobí sám a do dialogu je to predsa na wiki ! :)

 

ale už mě serete s tou wiki, forum atd

v tomto případě nemusí vůbec pawno.cz existovat a nemusí tu být žádný tuty pokud se vám víc líbí wiki tak sem nechoďte a hledejte si na vaší posrané wiki a aspon tu nebudou komenty ve stylu " toto si může každej najít na wiki " , wiki, wiki, wiki.. no koment.. wiki jestli chces tak ti to klidne udelam do dialogu.. jde videt že se vám člověk nezavděčí!

Link to comment
Share on other sites

tuto funkci nemam z wiki.. je 100% moje, id stylů sem si na našel v includu a_players pak to nefungovalo tak sem to ještě poupravoval a jde to.. ale nemam to z wiki

Link to comment
Share on other sites

ne není ale mohl sem si myslet že mi řeknete toto, funkce není moje, ale použití funkce sem se naučil sám, ikdyž je lehká.. ale žádná wiki

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...