Szerző Téma: Mytext parancs  (Megtekintve 1083 alkalommal)

Mytext parancs
« Dátum: 2012. Május 17. - 06:39:59 »
0 Show voters
Sziasztok!
Az lenne a probléma ezzel a scriptel hogy beirom /mytext ....
és ha kilépek és vissza akkor amilyen ID voltam annak a feje felett marad  és le kellene törülje ahogy kiléptem a szervebõl!
 
CMD:mytext(playerid, params[])
{
if(letrehozva[playerid] != 1)
{
new irni[64],Float:x,Float:y,Float:z;
format(irni,sizeof(irni),\" %s \",params);
GetPlayerPos(playerid,x,y,z);
szovege[playerid] = Create3DTextLabel(irni,0xFFFFFFFF,x,y,z,40, GetPlayerVirtualWorld(playerid), 0);
Attach3DTextLabelToPlayer(szovege[playerid], playerid, 0.0, 0.0, 0.7);
letrehozva[playerid] = 1;
SendClientMessage(playerid,-1,\"HASZNÁLAT: /mytext <szöveg>!\");
} else {
    new updated[64];
    format(updated,sizeof(updated),\" %s \",params);
    Update3DTextLabelText(szovege[playerid], 0xFFFFFFFF, updated);
    SendClientMessage(playerid,-1,\"Sikeresen frissítve!\");
}
return 1;
}
CMD:removetext(playerid, params[])
{
Delete3DTextLabel(szovege[playerid]);
SendClientMessage(playerid,-1,\"Sikeresen törölve!\");
letrehozva[playerid] = 0;
return 1;
}

Mytext parancs
« Válasz #1 Dátum: 2012. Május 17. - 06:43:36 »
+1 Show voters
Szia! Próbáld meg az [pawn]OnPlayerCommandText[/pawn] alá beírni [pawn]Delete3DTextLabel(szovege[playerid]);[/pawn]
Nem 100% biztos, hogy jó!
-coldridge

Mytext parancs
« Válasz #2 Dátum: 2012. Május 17. - 06:47:16 »
0 Show voters
Mi alá ZCMD-s a modom OnPlayerCommandText nincs benne..
Nem az OnPlayerDisconnect alá kel teni?

Mytext parancs
« Válasz #3 Dátum: 2012. Május 17. - 06:48:51 »
+1 Show voters
Idézetet írta: FastFurious date=1337230036\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"21571\" data-ipsquote-contentclass=\"forums_Topic
Mi alá ZCMD-s a modom OnPlayerCommandText nincs benne..
 
Attól, hogy ZCMD-s használhatsz benne fügvényt ha van [pawn]#include <a_samp>[/pawn] -od!
És ajánlott is mert így sokkal egyszerûbb.

Nem elérhető Gabor..

  • 1883
  • Gabor..
    • Profil megtekintése
Mytext parancs
« Válasz #4 Dátum: 2012. Május 17. - 07:04:39 »
+1 Show voters
ZCMD-t ajánlatos használni, mert egyszerû, gyors... Am ez a kód több sebbõl is vérzik. Majd, ha hazajöttem, megírom...
« Utoljára szerkesztve: 2012. Május 17. - 07:08:32 írta Gabor.. »

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Mytext parancs
« Válasz #5 Dátum: 2012. Május 17. - 07:27:59 »
+1 Show voters
            new updated[64];
            format(updated,sizeof(updated),\"%s\",params);
            Update3DTextLabelText(szovege[playerid], 0xFFFFFFFF, updated);
            SendClientMessage(playerid,-1,\"Sikeresen frissítve!\");

 
Ezzel nem tudom mit akarsz de összedobtam valamit, remélem müxik.
 
#include <a_samp>
#include <zcmd>
#include <sscanf2>
new Text3D:szovege[MAX_PLAYERS];
new letrehozva[MAX_PLAYERS];
CMD:mytext(playerid, params[])
{
if(sscanf(params, \"s[104]\", szovege[playerid])) return SendClientMessage(playerid,-1,\"HASZNÁLAT: /mytext <szöveg>!\");
        if(letrehozva[playerid] != 1)
        {
    szovege[playerid] = Create3DTextLabel(\"Hello, I am new here!\", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
    Attach3DTextLabelToPlayer(szovege[playerid], playerid, 0.0, 0.0, 0.7);
   letrehozva[playerid] = 1;
        } else {
            new updated[64];
            format(updated,sizeof(updated),\"%s\",params);
            Update3DTextLabelText(szovege[playerid], 0xFFFFFFFF, updated);
            SendClientMessage(playerid,-1,\"Sikeresen frissítve!\");
        }
        return 1;
}

Mytext parancs
« Válasz #6 Dátum: 2012. Május 17. - 07:35:25 »
+1 Show voters
Annyit megsúgok, hogy OnPlayerDisconnectnél kell csinni 1-2 dolgot.A többire gyere rá magadtól..

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Mytext parancs
« Válasz #7 Dátum: 2012. Május 17. - 11:10:21 »
+1 Show voters
public OnPlayerDisconnect(playerid, reason)
{
        Delete3DTextLabel(szovege[playerid]);
        letrehozva[playerid] = 0;
        return 1;
}

Nem elérhető Gabor..

  • 1883
  • Gabor..
    • Profil megtekintése
Mytext parancs
« Válasz #8 Dátum: 2012. Május 17. - 12:00:09 »
+2 Show voters
Tessék:
 
#include <  a_samp    >
#include <  zcmd      >
#include <  sscanf2   >
new
 Text3D: szovege[ MAX_PLAYERS ],
 pText[ 50 ],
 Float: fPos[ 3 ];
public OnPlayerConnect( playerid )
{
   SetPVarInt( playerid, \" Text \", 0 );
   return 1;
}
public OnPlayerDisconnect( playerid, reason )
{
   SetPVarInt( playerid, \" Text \", 0 );
   
   if( GetPVarInt( playerid, \" Text \" ) == 1 )
   {
      Delete3DTextLabel( szovege[ playerid ] );
   }
   return 1;
}
CMD:mytext(playerid, params[])
{
        if( GetPVarInt( playerid, \" Text \" ) == 0 )
        {
               
                if( sscanf( params, \"s[ 50 ]\", pText ) ) return SendClientMessage( playerid, 0xFF0000AA, \" Használat: /mytext <Szöveg> \" );
GetPlayerPos( playerid, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ] );
                szovege[playerid] = Create3DTextLabel( pText, 0xFFFFFFFF, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ], 40, GetPlayerVirtualWorld( playerid ), 0 );
                Attach3DTextLabelToPlayer( szovege[ playerid ], playerid, 0.0, 0.0, 0.7 );
                SetPVarInt( playerid, \" Text \", 1 );
        }
        else
{
                if( sscanf( params, \"s[40] \", pText ) ) return SendClientMessage( playerid, 0xFF0000AA, \" Használat: /mytext <Szöveg> \" );
                Update3DTextLabelText( szovege[ playerid ], 0xFFFFFFFF, pText );
           
        }
        return 1;
}
CMD:removetext(playerid, params[])
{
        Delete3DTextLabel( szovege[ playerid ] );
        SendClientMessage( playerid, -1, \"Sikeresen törölve!\" );
        SetPVarInt( playerid, \" Text \", 1 );
        return 1;
}
« Utoljára szerkesztve: 2012. Május 17. - 12:22:18 írta Gabor.. »

Mytext parancs
« Válasz #9 Dátum: 2012. Május 17. - 12:40:53 »
0 Show voters
kösz kösz nah most jó ment a +

Mytext parancs
« Válasz #10 Dátum: 2012. Május 17. - 06:39:59 »
0 Show voters
Sziasztok!
Az lenne a probléma ezzel a scriptel hogy beirom /mytext ....
és ha kilépek és vissza akkor amilyen ID voltam annak a feje felett marad  és le kellene törülje ahogy kiléptem a szervebõl!
 
CMD:mytext(playerid, params[])
{
if(letrehozva[playerid] != 1)
{
new irni[64],Float:x,Float:y,Float:z;
format(irni,sizeof(irni),\" %s \",params);
GetPlayerPos(playerid,x,y,z);
szovege[playerid] = Create3DTextLabel(irni,0xFFFFFFFF,x,y,z,40, GetPlayerVirtualWorld(playerid), 0);
Attach3DTextLabelToPlayer(szovege[playerid], playerid, 0.0, 0.0, 0.7);
letrehozva[playerid] = 1;
SendClientMessage(playerid,-1,\"HASZNÁLAT: /mytext <szöveg>!\");
} else {
    new updated[64];
    format(updated,sizeof(updated),\" %s \",params);
    Update3DTextLabelText(szovege[playerid], 0xFFFFFFFF, updated);
    SendClientMessage(playerid,-1,\"Sikeresen frissítve!\");
}
return 1;
}
CMD:removetext(playerid, params[])
{
Delete3DTextLabel(szovege[playerid]);
SendClientMessage(playerid,-1,\"Sikeresen törölve!\");
letrehozva[playerid] = 0;
return 1;
}

Mytext parancs
« Válasz #11 Dátum: 2012. Május 17. - 06:43:36 »
0 Show voters
Szia! Próbáld meg az [pawn]OnPlayerCommandText[/pawn] alá beírni [pawn]Delete3DTextLabel(szovege[playerid]);[/pawn]
Nem 100% biztos, hogy jó!
-coldridge

Mytext parancs
« Válasz #12 Dátum: 2012. Május 17. - 06:47:16 »
0 Show voters
Mi alá ZCMD-s a modom OnPlayerCommandText nincs benne..
Nem az OnPlayerDisconnect alá kel teni?

Mytext parancs
« Válasz #13 Dátum: 2012. Május 17. - 06:48:51 »
0 Show voters
Idézetet írta: FastFurious date=1337230036\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"21571\" data-ipsquote-contentclass=\"forums_Topic
Mi alá ZCMD-s a modom OnPlayerCommandText nincs benne..
 
Attól, hogy ZCMD-s használhatsz benne fügvényt ha van [pawn]#include <a_samp>[/pawn] -od!
És ajánlott is mert így sokkal egyszerûbb.

Nem elérhető Gabor..

  • 1883
  • Gabor..
    • Profil megtekintése
Mytext parancs
« Válasz #14 Dátum: 2012. Május 17. - 07:04:39 »
0 Show voters
ZCMD-t ajánlatos használni, mert egyszerû, gyors... Am ez a kód több sebbõl is vérzik. Majd, ha hazajöttem, megírom...
« Utoljára szerkesztve: 2012. Május 17. - 07:08:32 írta Gabor.. »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal