Szerző Téma: Textdrawba pénz  (Megtekintve 769 alkalommal)

Nem elérhető Th0mas

  • 278
    • Profil megtekintése
Textdrawba pénz
« Dátum: 2015. május 27. - 18:13:19 »
0 Show voters
Sziasztok!
Valaki írna egy példa scriptet,hogy hogy lehetne textdrawba pénzt tenni?
Itt a textdrawom,csak nem tudom hogy kell
 

new Text:Textdraw1;
new Text:Textdraw2;
 
Textdraw1 = TextDrawCreate(641.500000, 425.000000, \"usebox\");
TextDrawLetterSize(Textdraw1, 0.000000, 2.340742);
TextDrawTextSize(Textdraw1, -2.000000, 0.000000);
TextDrawAlignment(Textdraw1, 1);
TextDrawColor(Textdraw1, 0);
TextDrawUseBox(Textdraw1, true);
TextDrawBoxColor(Textdraw1, 102);
TextDrawSetShadow(Textdraw1, 0);
TextDrawSetOutline(Textdraw1, 0);
TextDrawFont(Textdraw1, 0);
Textdraw2 = TextDrawCreate(0.500000, 422.916687, \"x\");
TextDrawLetterSize(Textdraw2, 0.449999, 1.600000);
TextDrawAlignment(Textdraw2, 1);
TextDrawColor(Textdraw2, -1);
TextDrawSetShadow(Textdraw2, 0);
TextDrawSetOutline(Textdraw2, 1);
TextDrawBackgroundColor(Textdraw2, 51);
TextDrawFont(Textdraw2, 1);
TextDrawSetProportional(Textdraw2, 1);
 
TextDrawShowForPlayer(playerid,Textdraw1);
TextDrawShowForPlayer(playerid,Textdraw2);
« Utoljára szerkesztve: 2015. május 27. - 21:57:38 írta ƒlaﻛh »

Nem elérhető Nátha

  • 1036
    • Profil megtekintése
Textdrawba pénz
« Válasz #1 Dátum: 2015. május 27. - 19:36:23 »
0 Show voters
Itt van komplett scriptbe írva, hogy tudd tesztelni, mert nekem most nincs fent a SAMP :)
 
#include <a_samp>
new Text:Textdraw1[MAX_PLAYERS];
new Text:Textdraw2[MAX_PLAYERS];
new check;
 
public OnPlayerConnect(playerid)
{
Textdraw1[playerid] = TextDrawCreate(641.500000, 425.000000, \"usebox\");
TextDrawLetterSize(Textdraw1[playerid], 0.000000, 2.340742);
     TextDrawTextSize(Textdraw1[playerid], -2.000000, 0.000000);
      TextDrawAlignment(Textdraw1[playerid], 1);
    TextDrawColor(Textdraw1[playerid], 0);
    TextDrawUseBox(Textdraw1[playerid], true);
    TextDrawBoxColor(Textdraw1[playerid], 102);
    TextDrawSetShadow(Textdraw1[playerid], 0);
    TextDrawSetOutline(Textdraw1[playerid], 0);
    TextDrawFont(Textdraw1[playerid], 0);
Textdraw2[playerid] = TextDrawCreate(0.500000, 422.916687, \"00000000Ft\");
TextDrawLetterSize(Textdraw2[playerid], 0.449999, 1.600000);
     TextDrawAlignment(Textdraw2[playerid], 1);
      TextDrawColor(Textdraw2[playerid], -1);
    TextDrawSetShadow(Textdraw2[playerid], 0);
    TextDrawSetOutline(Textdraw2[playerid], 1);
    TextDrawBackgroundColor(Textdraw2[playerid], 51);
    TextDrawFont(Textdraw2[playerid], 1);
    TextDrawSetProportional(Textdraw2[playerid], 1);
    SetTimerEx(\"CheckMoney\", 2000, true, \"i\", playerid);
    return 1;
}
public OnPlayerDisconnect(playerid)
{
TextDrawHideForPlayer(playerid, Textdraw1[playerid]);
TextDrawHideForPlayer(playerid, Textdraw2[playerid]);
return 1;
}
           
           
public OnFilterScriptExit()
{
KillTimer(check);
return 1;
}
forward CheckMoney(playerid);
public CheckMoney(playerid)
{
    new string[128];
if(GetPlayerMoney(playerid) < 10)
{
format(string, sizeof(string), \"0000000%iFt\", GetPlayerMoney(playerid));
TextDrawSetString(Textdraw2[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
if(10 <= GetPlayerMoney(playerid) < 100)
{
format(string, sizeof(string), \"000000%iFt\", GetPlayerMoney(playerid));
TextDrawSetString(Textdraw2[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
if(100 <= GetPlayerMoney(playerid) < 1000)
{
format(string, sizeof(string), \"00000%iFt\", GetPlayerMoney(playerid));
TextDrawSetString(Textdraw2[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
if(1000 <= GetPlayerMoney(playerid) < 10000)
{
format(string, sizeof(string), \"0000%iFt\", GetPlayerMoney(playerid));
TextDrawSetString(Textdraw2[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
if(10000 <= GetPlayerMoney(playerid) < 100000)
{
format(string, sizeof(string), \"000%iFt\", GetPlayerMoney(playerid));
TextDrawSetString(Textdraw2[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
if(100000 <= GetPlayerMoney(playerid) < 1000000)
{
format(string, sizeof(string), \"00%iFt\", GetPlayerMoney(playerid));
TextDrawSetString(Textdraw2[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
if(1000000 <= GetPlayerMoney(playerid) < 10000000)
{
format(string, sizeof(string), \"0%iFt\", GetPlayerMoney(playerid));
TextDrawSetString(Textdraw2[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
if(10000000 <= GetPlayerMoney(playerid) < 999999999)
{
format(string, sizeof(string), \"%iFt\", GetPlayerMoney(playerid));
TextDrawSetString(Textdraw2[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
return 1;
}

Nem elérhető Th0mas

  • 278
    • Profil megtekintése
Textdrawba pénz
« Válasz #2 Dátum: 2015. május 30. - 10:58:02 »
0 Show voters
És ha pl pontot szeretnék akkor hogy?

Nem elérhető Nátha

  • 1036
    • Profil megtekintése
Textdrawba pénz
« Válasz #3 Dátum: 2015. május 30. - 19:57:41 »
+1 Show voters
Hát ha úgy akarod mint a pénz jelzőt és van 500 pontod akkor azt így jelezze ki: 00000500 akkor:
 
#include <a_samp>
new Text:Textdraw1[MAX_PLAYERS];
new Text:Textdraw2[MAX_PLAYERS];
new check;
 
public OnPlayerConnect(playerid)
{
Textdraw1[playerid] = TextDrawCreate(641.500000, 425.000000, \"usebox\");
TextDrawLetterSize(Textdraw1[playerid], 0.000000, 2.340742);
     TextDrawTextSize(Textdraw1[playerid], -2.000000, 0.000000);
      TextDrawAlignment(Textdraw1[playerid], 1);
    TextDrawColor(Textdraw1[playerid], 0);
    TextDrawUseBox(Textdraw1[playerid], true);
    TextDrawBoxColor(Textdraw1[playerid], 102);
    TextDrawSetShadow(Textdraw1[playerid], 0);
    TextDrawSetOutline(Textdraw1[playerid], 0);
    TextDrawFont(Textdraw1[playerid], 0);
Textdraw2[playerid] = TextDrawCreate(0.500000, 422.916687, \"00000000\");
TextDrawLetterSize(Textdraw2[playerid], 0.449999, 1.600000);
     TextDrawAlignment(Textdraw2[playerid], 1);
      TextDrawColor(Textdraw2[playerid], -1);
    TextDrawSetShadow(Textdraw2[playerid], 0);
    TextDrawSetOutline(Textdraw2[playerid], 1);
    TextDrawBackgroundColor(Textdraw2[playerid], 51);
    TextDrawFont(Textdraw2[playerid], 1);
    TextDrawSetProportional(Textdraw2[playerid], 1);
    SetTimerEx(\"CheckScore\", 2000, true, \"i\", playerid);
    return 1;
}
public OnPlayerDisconnect(playerid)
{
TextDrawHideForPlayer(playerid, Textdraw1[playerid]);
TextDrawHideForPlayer(playerid, Textdraw2[playerid]);
return 1;
}
 
public OnFilterScriptExit()
{
KillTimer(check);
return 1;
}
forward CheckScore(playerid);
public CheckScore(playerid)
{
    new string[128];
if(GetPlayerScore(playerid) < 10)
{
format(string, sizeof(string), \"0000000%i\", GetPlayerScore(playerid));
TextDrawSetString(Textdraw2[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
if(10 <= GetPlayerScore(playerid) < 100)
{
format(string, sizeof(string), \"000000%i\", GetPlayerScore(playerid));
TextDrawSetString(Textdraw2[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
if(100 <= GetPlayerScore(playerid) < 1000)
{
format(string, sizeof(string), \"00000%iFt\", GetPlayerScore(playerid));
TextDrawSetString(Textdraw2[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
if(1000 <= GetPlayerScore(playerid) < 10000)
{
format(string, sizeof(string), \"0000%i\", GetPlayerScore(playerid));
TextDrawSetString(Textdraw2[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
if(10000 <= GetPlayerScore(playerid) < 100000)
{
format(string, sizeof(string), \"000%i\", GetPlayerScore(playerid));
TextDrawSetString(Textdraw2[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
if(100000 <= GetPlayerScore(playerid) < 1000000)
{
format(string, sizeof(string), \"00%i\", GetPlayerScore(playerid));
TextDrawSetString(Textdraw2[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
if(1000000 <= GetPlayerScore(playerid) < 10000000)
{
format(string, sizeof(string), \"0%i\", GetPlayerScore(playerid));
TextDrawSetString(Textdraw2[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
if(10000000 <= GetPlayerScore(playerid) < 999999999)
{
format(string, sizeof(string), \"%i\", GetPlayerScore(playerid));
TextDrawSetString(Textdraw2[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
return 1;
}

 
Vagy ha csak szimplán kiszeretnéd írni hogy 500 akkor:
 
#include <a_samp>
new Text:Textdraw1[MAX_PLAYERS];
new Text:Textdraw2[MAX_PLAYERS];
new check;
 
public OnPlayerConnect(playerid)
{
Textdraw1[playerid] = TextDrawCreate(641.500000, 425.000000, \"usebox\");
TextDrawLetterSize(Textdraw1[playerid], 0.000000, 2.340742);
     TextDrawTextSize(Textdraw1[playerid], -2.000000, 0.000000);
      TextDrawAlignment(Textdraw1[playerid], 1);
    TextDrawColor(Textdraw1[playerid], 0);
    TextDrawUseBox(Textdraw1[playerid], true);
    TextDrawBoxColor(Textdraw1[playerid], 102);
    TextDrawSetShadow(Textdraw1[playerid], 0);
    TextDrawSetOutline(Textdraw1[playerid], 0);
    TextDrawFont(Textdraw1[playerid], 0);
Textdraw2[playerid] = TextDrawCreate(0.500000, 422.916687, \"0\");
TextDrawLetterSize(Textdraw2[playerid], 0.449999, 1.600000);
     TextDrawAlignment(Textdraw2[playerid], 1);
      TextDrawColor(Textdraw2[playerid], -1);
    TextDrawSetShadow(Textdraw2[playerid], 0);
    TextDrawSetOutline(Textdraw2[playerid], 1);
    TextDrawBackgroundColor(Textdraw2[playerid], 51);
    TextDrawFont(Textdraw2[playerid], 1);
    TextDrawSetProportional(Textdraw2[playerid], 1);
    SetTimerEx(\"CheckScore\", 2000, true, \"i\", playerid);
    return 1;
}
public OnPlayerDisconnect(playerid)
{
TextDrawHideForPlayer(playerid, Textdraw1[playerid]);
TextDrawHideForPlayer(playerid, Textdraw2[playerid]);
return 1;
}
 
public OnFilterScriptExit()
{
KillTimer(check);
return 1;
}
forward CheckScore(playerid);
public CheckScore(playerid)
{
    new string[128];
if(GetPlayerScore(playerid))
{
format(string, sizeof(string), \"%i\", GetPlayerScore(playerid));
TextDrawSetString(Textdraw2[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
}
return 1;
}

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Textdrawba pénz
« Válasz #4 Dátum: 2015. június 14. - 23:36:21 »
0 Show voters
[mod]Zárom.[/mod]

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal