Jump to content

Ajutor Script #2


angelo034

Recommended Posts

Vreau sa fac o capacitate la un vehicul

Eu de exemplu am asa 

if(vehicleid == MasiniDistribuitor[0] || vehicleid == MasiniDistribuitor[1] || vehicleid == MasiniDistribuitor[2] || vehicleid ==  MasiniDistribuitor[3]

La masini am create masinile de distribuitor 

Am pus fazele cu         GetXYBehindVehicle(vehicleid, &Float:q, &Float:w, Float:distance)
        {
        new Float:a;
        GetVehiclePos(vehicleid, q, w, a);
        GetVehicleZAngle(vehicleid, a);
        q += (distance * -floatsin(-a, degrees));
        w += (distance * -floatcos(-a, degrees));

Si vreau sa fac o capacitate De exemplu cand apas tasta  KEY_YES**  de valoare 65536 sa aiba o capacitate de 0/50 si cand apas prima data Y in spatele vehicului sa mi se umple cu un numar random cu 5 si 10 adica sa aiba o sansa de 5 sloturi si 10 sloturi.. sper ca stiti la ce m-am referit daca nu m-am referit foarte bine puteti sa imi puneti intrebari..

Link to comment
Share on other sites

Astea te vor ajuta cu tastele https://wiki.sa-mp.com/wiki/Keys http://wiki.sa-mp.com/wiki/OnPlayerKeyStateChange, asta te va ajuta cu random-ul http://wiki.sa-mp.com/wiki/Random sau functia 

stock randomEx(minnum = cellmin, maxnum = cellmax) return random(maxnum - minnum + 1) + minnum; 

In rest e vorba de variabilele pe care le ai tu.

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Link to comment
Share on other sites

Ma refer de exemplu la jobul Garbage man sa aiba un storage de 350 de kg de gunoi si cand intru in masina sa imi puna un checkpoint iar la checkpoint trb sa ma dau jos din masina intru in checkpoint si imi da ceva in mana si de acolo sa apas Y in spatele masinii si sa imi umple storage-u cu 10kg de gunoi 

Vreau doar partea cu storage-u restu cu checkpoint, cu Y in spatele masinii stiu doar partea cu storage-u

Edited by angelo034
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.