Jump to content

Question

Posted

Cum fac si eu sa pot da viata peste 100....

Ca nu merge cu nimic, daca dau cu /sethp 0 300 nu merge imi da tot 100hp da nush dc ?

i0418xcttya707ofg.jpg

8 answers to this question

Recommended Posts

Posted

Cum fac si eu sa pot da viata peste 100....

Ca nu merge cu nimic, daca dau cu /sethp 0 300 nu merge imi da tot 100hp da nush dc ?

De ce nu te uiti in script ?

Posted

Care script ?

Fi mai precis ca nush unde sa caut .... ???

Am o comanda care contine SetPlayerHealth(playerid,9999); si tot 100hp imi da :((

i0418xcttya707ofg.jpg

Posted

Poate scriptul verifica daca valoarea ii peste 100, atunci iti va seta viata la 100, ci nu la valoarea initiala.

Posted

LaZ" post="36858" timestamp="1280509673"]

Poate scriptul verifica daca valoarea ii peste 100, atunci iti va seta viata la 100, ci nu la valoarea initiala.

Cauta pe la OnPlayerUpdate(playerid):

if(GetPlayerHealth(playerid)>=100)
{
    SetPlayerHealth(playerid, 100);
}

ar trebui sa gasesti ceva cam la fel :D

Posted

Cauta pe la OnPlayerUpdate(playerid):

if(GetPlayerHealth(playerid)>=100)
{
    SetPlayerHealth(playerid, 100);
}

ar trebui sa gasesti ceva cam la fel :D

Posted

Uite comanda mea /sethp

Da eu zic ca nui de la comanda ca si la scut e la fel. :(

E ceva prin gm setat da nush ce .

Abar nam de la ce poate fi . :'(

if(strcmp(cmd, "/sethp", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /sethp [playerid/PartOfName] [health]");

return 1;

}

new playa;

new health;

GetPlayerName(playa, sendername, sizeof(sendername));

playa = ReturnUser(tmp);

tmp = strtok(cmdtext, idx);

health = strval(tmp);

if (PlayerInfo[playerid][pAdmin] >= 1337)

{

    if(IsPlayerConnected(playa))

    {

        if(playa != INVALID_PLAYER_ID)

        {

SetPlayerHealth(playa, health);

GetPlayerName(playa, giveplayer, sizeof(giveplayer));

GetPlayerName(playerid, sendername, sizeof(sendername));

format(string, 256, "News: %s has set %s's hp to %d.", sendername,giveplayer,health);

ABroadCast(COLOR_ADMIN,string,1);

}

}

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  you are not authorized to use that command!");

}

}

return 1;

}

i0418xcttya707ofg.jpg

Posted

Viata unui jucator ii o valoare de tip FLOAT, adica variabila 'health' trebuie sa fie FLOAT, nu INTEGER cum ii in acel exemplu. Ca sa transformi acel integer in float, va trebui sa inlocuiesti linia SetPlayerHealth( playa, health ); cu SetPlayerHealth( playa, float( health ) );

float( integer ) transforma integer-ul dat intr-o valoare tip float.

Posted

Am primit PM de la el spunand ca nu merge sa seteze peste 100, cred ca ii mai corect sa se foloseasca floatstr in loc de float.

Am facut o comanda, folosind floatstr am reusit sa setez viata peste 100.

http://pastebin.com/796HzSWU - Script folosit

http://img824.imageshack.us/img824/8169/samp447.png - Screenshot

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.