Szerző Téma: Health  (Megtekintve 1114 alkalommal)

Health
« Dátum: 2010. október 29. - 17:04:29 »
0 Show voters
Üdv all
azt szeretném tõletek kérdezni hogy azt hogy lehet megcsinálni hogy a player életét mutasa számall pl leugrik valahonnan és akkor pl 100% volt az élete és akkor lemegy valamenyit és akkor mutasa h márcsak 90% élete maradt pl xD nah ezt szeretném  és persze az armourban is ugyan igy
elõreis thx

Nem elérhető maark

  • 565
    • Profil megtekintése
Health
« Válasz #1 Dátum: 2010. október 29. - 21:20:21 »
0 Show voters
hát a % karaktert nem írja ki a samp
De asszem talán így:
 
#include a_samp
new Text:spe[MAX_PLAYERS], timer[MAX_PLAYERS];
public OnPlayerConnect(playerid){
KillTimer(timer[playerid]);
spe[playerid] = TextDrawCreate(410.000000,435.000000,\"_\");
TextDrawFont(spe[playerid],1);
TextDrawColor(spe[playerid],0x99FF00AA);
TextDrawLetterSize(spe[playerid],0.599999,1.000000);
TextDrawSetOutline(spe[playerid],1);
TextDrawSetShadow(spe[playerid],1);
TextDrawSetProportional(spe[playerid],1);
TextDrawBackgroundColor(spe[playerid],0x000000ff);
TextDrawTextSize(spe[playerid], 3, 3);
        timer[playerid]=SetTimerEx(\"check\", 100, true, \"i\", playerid);
        TextDrawHideForPlayer(playerid, spe[playerid]);
        return 1;
}
public OnPlayerRequestSpawn(playerid) return TextDrawShowForPlayer(playerid, spe[playerid]);
public OnPlayerDisconnect(playerid) return KillTimer(timer[playerid]);
forward check(playerid);
public check(playerid){
new Float:hp, str[100];
GetPlayerHealth(playerid, hp);
format(str, sizeof str, \"%f_hp\", hp);
TextDrawSetString(spe[playerid], str);
TextDrawShowForPlayer(playerid, spe[playerid]);
return 1;
}

 
nem tetszteltem

Health
« Válasz #2 Dátum: 2010. október 30. - 08:52:41 »
0 Show voters
nah jonak jo csak nem oda szeretem volna hanem bele az életbe és csak elég lenne anyi h 90 pl és nem enyi h  100.00000 xD mert betetem és ezt csinálta meg nem oda szeretném:D

Nem elérhető KDDomi

  • 976
    • Profil megtekintése
Health
« Válasz #3 Dátum: 2010. október 30. - 09:35:15 »
0 Show voters
tessék:
 
#include <a_samp>
new Text:HealthBar[MAX_PLAYERS];
new Text:ArmourBar[MAX_PLAYERS];
new Text:VehHealthBar[MAX_PLAYERS];
new Text:VehHealthBox1[MAX_PLAYERS];
new Text:VehHealthBox3[MAX_PLAYERS];
new Text:VehHealthBox2[MAX_PLAYERS];
public OnFilterScriptInit()
{
print(\"\\n|==========================================================|\");
print(\"|                      Elet                                                                                 \");
print(\"|                  Betoltve!                                                                              \");
print(\"|==========================================================|\\n\");
return 1;
}
public OnPlayerConnect(playerid)
{
HealthBar[playerid] = TextDrawCreate(548.000000, 66.000000, \"100\");
TextDrawBackgroundColor(HealthBar[playerid], 255);
TextDrawFont(HealthBar[playerid], 1);
TextDrawLetterSize(HealthBar[playerid], 0.280000, 1.000000);
TextDrawColor(HealthBar[playerid], -1);
TextDrawSetOutline(HealthBar[playerid], 1);
TextDrawSetProportional(HealthBar[playerid], 1);
ArmourBar[playerid] = TextDrawCreate(548.000000, 43.000000, \"100\");
TextDrawBackgroundColor(ArmourBar[playerid], 255);
TextDrawFont(ArmourBar[playerid], 1);
TextDrawLetterSize(ArmourBar[playerid], 0.290000, 1.100000);
TextDrawColor(ArmourBar[playerid], -1);
TextDrawSetOutline(ArmourBar[playerid], 1);
TextDrawSetProportional(ArmourBar[playerid], 1);
VehHealthBox1[playerid] = TextDrawCreate(547.000000, 9.000000, \"..........\");
TextDrawBackgroundColor(VehHealthBox1[playerid], 255);
TextDrawFont(VehHealthBox1[playerid], 3);
TextDrawLetterSize(VehHealthBox1[playerid], 0.599999, 3.999999);
TextDrawColor(VehHealthBox1[playerid], 255);
TextDrawSetOutline(VehHealthBox1[playerid], 1);
TextDrawSetProportional(VehHealthBox1[playerid], 1);
VehHealthBox2[playerid] = TextDrawCreate(549.000000, 22.000000, \"~g~..........\");
TextDrawBackgroundColor(VehHealthBox2[playerid], 912665855);
TextDrawFont(VehHealthBox2[playerid], 3);
TextDrawLetterSize(VehHealthBox2[playerid], 0.560000, 2.200000);
TextDrawColor(VehHealthBox2[playerid], -1);
TextDrawSetOutline(VehHealthBox2[playerid], 1);
TextDrawSetProportional(VehHealthBox2[playerid], 1);
VehHealthBox3[playerid] = TextDrawCreate(549.000000, 22.000000, \"~g~~h~.........\");
TextDrawBackgroundColor(VehHealthBox3[playerid], 1369064191);
TextDrawFont(VehHealthBox3[playerid], 3);
TextDrawLetterSize(VehHealthBox3[playerid], 0.560000, 2.200000);
TextDrawColor(VehHealthBox3[playerid], -1);
TextDrawSetOutline(VehHealthBox3[playerid], 1);
TextDrawSetProportional(VehHealthBox3[playerid], 1);
VehHealthBar[playerid] = TextDrawCreate(548.000000, 32.000000, \"100\");
TextDrawBackgroundColor(VehHealthBar[playerid], 255);
TextDrawFont(VehHealthBar[playerid], 1);
TextDrawLetterSize(VehHealthBar[playerid], 0.290000, 1.100000);
TextDrawColor(VehHealthBar[playerid], -1);
TextDrawSetOutline(VehHealthBar[playerid], 1);
TextDrawSetProportional(VehHealthBar[playerid], 1);
return 1;
}
public OnPlayerSpawn(playerid)
{
     TextDrawShowForPlayer(playerid,HealthBar[playerid]);
     TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
     TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
     TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
     TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
     TextDrawShowForPlayer(playerid,ArmourBar[playerid]);
     return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
     TextDrawHideForPlayer(playerid,HealthBar[playerid]);
     TextDrawHideForPlayer(playerid,VehHealthBox1[playerid]);
     TextDrawHideForPlayer(playerid,VehHealthBox2[playerid]);
     TextDrawHideForPlayer(playerid,VehHealthBox3[playerid]);
     TextDrawHideForPlayer(playerid,VehHealthBar[playerid]);
     TextDrawHideForPlayer(playerid,ArmourBar[playerid]);
     return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
     TextDrawSetString(HealthBar[playerid],\"Meghaltal!\");
     return 1;
}
public OnPlayerUpdate(playerid)
{
     new Float:Health;
     new HealthString[15];
     GetPlayerHealth(playerid,Health);
     format(HealthString, 15, \"       %d\",floatround(Health));
     TextDrawSetString(HealthBar[playerid],HealthString);
     TextDrawShowForPlayer(playerid,HealthBar[playerid]);
   new Float:Armour;
    GetPlayerArmour(playerid,Armour);
    if(Armour > 0)
{
      new ArmourString[15];
      format(ArmourString, 15, \"       %d\",floatround(Armour));
         TextDrawSetString(ArmourBar[playerid],ArmourString);
         TextDrawShowForPlayer(playerid,ArmourBar[playerid]);
}
else
{
    TextDrawHideForPlayer(playerid,ArmourBar[playerid]);
}
if(IsPlayerInAnyVehicle(playerid))
{
      new Float:VehHealth;
      new TrueVehHealth;
      new VehHealthString[15];
      GetVehicleHealth(GetPlayerVehicleID(playerid),VehHealth);
      TrueVehHealth = floatround(floatround(VehHealth - 250)/ 7.5);
      format(VehHealthString, 15, \"       %d\",floatround(TrueVehHealth));
        TextDrawSetString(VehHealthBar[playerid],VehHealthString);
         if (TrueVehHealth == -33)
   {
        TextDrawSetString(VehHealthBar[playerid],\"Halal\");
                TextDrawSetString(VehHealthBox3[playerid],\"~g~~h~\");
      TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
       }
       else if (TrueVehHealth < 1)
   {
        TextDrawSetString(VehHealthBar[playerid],\"Tuz!\");
                TextDrawSetString(VehHealthBox3[playerid],\"~g~~h~\");
      TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
       }
       else if (TrueVehHealth < 10)
   {
               TextDrawSetString(VehHealthBox3[playerid],\"~g~~h~.\");
      TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
       }
   else if (TrueVehHealth < 20)
   {
               TextDrawSetString(VehHealthBox3[playerid],\"~g~~h~..\");
      TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
               TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
       }
       else if (TrueVehHealth < 30)
   {
               TextDrawSetString(VehHealthBox3[playerid],\"~g~~h~...\");
      TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
       else if (TrueVehHealth < 40)
   {
               TextDrawSetString(VehHealthBox3[playerid],\"~g~~h~....\");
      TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
       }
       else if (TrueVehHealth < 50)
   {
               TextDrawSetString(VehHealthBox3[playerid],\"~g~~h~.....\");
      TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
       }
       else if (TrueVehHealth < 60)
   {
               TextDrawSetString(VehHealthBox3[playerid],\"~g~~h~......\");
      TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
       }
       else if (TrueVehHealth < 70)
   {
               TextDrawSetString(VehHealthBox3[playerid],\"~g~~h~.......\");
      TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
       }
   else if (TrueVehHealth < 80)
   {
               TextDrawSetString(VehHealthBox3[playerid],\"~g~~h~........\");
      TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
       }
       else if (TrueVehHealth < 90)
   {
               TextDrawSetString(VehHealthBox3[playerid],\"~g~~h~.........\");
      TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
                               TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
               }
       else if (TrueVehHealth < 100)
   {
               TextDrawSetString(VehHealthBox3[playerid],\"~g~~h~..........\");
      TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
       }
          else if (TrueVehHealth == 100)
   {
               TextDrawSetString(VehHealthBox3[playerid],\"~g~~h~..........\");
      TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
      TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
       }
}
else
{
TextDrawHideForPlayer(playerid,VehHealthBox1[playerid]);
      TextDrawHideForPlayer(playerid,VehHealthBox2[playerid]);
      TextDrawHideForPlayer(playerid,VehHealthBox3[playerid]);
      TextDrawHideForPlayer(playerid,VehHealthBar[playerid]);
}
   return 1;
}
public OnFilterScriptExit()
{
for(new i; i<GetMaxPlayers(); i++)
{
    if(IsPlayerConnected(i))
    {
    TextDrawDestroy(VehHealthBox1);
       TextDrawDestroy(VehHealthBox2);
       TextDrawDestroy(VehHealthBox3);
       TextDrawDestroy(VehHealthBar);
       TextDrawDestroy(HealthBar);
       TextDrawDestroy(ArmourBar);
    }
}
return 1;
}
« Utoljára szerkesztve: 2010. október 30. - 09:36:58 írta KDDomi »

Health
« Válasz #4 Dátum: 2010. október 30. - 09:46:00 »
0 Show voters
betetem és 4 error van betudnád teni filterscriptbe nekem?? esetleg pm be megadom az msn em és elkûldõd vagy nem tudom:D

Nem elérhető KDDomi

  • 976
    • Profil megtekintése
Health
« Válasz #5 Dátum: 2010. október 30. - 09:48:02 »
0 Show voters
Küld pm ben az msn en cimed ;)

Health
« Válasz #6 Dátum: 2010. október 30. - 09:50:31 »
0 Show voters

Health
« Válasz #7 Dátum: 2010. október 30. - 10:01:24 »
0 Show voters
elkûldtem pm ben az msn em :)
E:
megvan témát zárom:D 8)
ChuckNorris: Ebben a témában igértem neked valamit.(Utolsó hsz...,és elnézést hogy zárt témába írok.)
http://sampforum.hu/index.php?topic=7444.msg87864;topicseen#msg87864
« Utoljára szerkesztve: 2010. október 31. - 17:28:47 írta ChuckNorris »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal