leon Posted July 30, 2010 Posted July 30, 2010 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 ?
LaZ Posted July 30, 2010 Posted July 30, 2010 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 ?
leon Posted July 30, 2010 Author Posted July 30, 2010 Care script ?Fi mai precis ca nush unde sa caut .... ???Am o comanda care contine SetPlayerHealth(playerid,9999); si tot 100hp imi da (
LaZ Posted July 30, 2010 Posted July 30, 2010 Poate scriptul verifica daca valoarea ii peste 100, atunci iti va seta viata la 100, ci nu la valoarea initiala.
IstuntmanI Posted July 30, 2010 Posted July 30, 2010 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
LaZ Posted July 30, 2010 Posted July 30, 2010 Cauta pe la OnPlayerUpdate(playerid):if(GetPlayerHealth(playerid)>=100) { SetPlayerHealth(playerid, 100); }ar trebui sa gasesti ceva cam la fel
leon Posted July 30, 2010 Author Posted July 30, 2010 Uite comanda mea /sethpDa 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; }
LaZ Posted July 30, 2010 Posted July 30, 2010 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.
LaZ Posted July 30, 2010 Posted July 30, 2010 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 folosithttp://img824.imageshack.us/img824/8169/samp447.png - Screenshot
Question
leon
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 ?
8 answers to this question
Recommended Posts