Szerző Téma: 3D text a játékos feje fölött  (Megtekintve 1200 alkalommal)

3D text a játékos feje fölött
« Dátum: 2011. Április 20. - 19:49:12 »
0 Show voters
Sziasztok,abban szeretném segítségeteket kérni,hogy szeretnék csinálni egy olyan scriptet a szerveremhez,hogy ha mondjuk beírja a player azt a parancsot hogy /smtl [szöveg] szöveggel együtt,akkor egy 3D text-t rak a fejel fölé,természetesen,amit beírt.
Elkezdtem már,de elakadtam :D
 
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(smtl,5,cmdtext);
return 0;
}

 

dcmd_smtl(playerid,params[])
{
   new PlayerText3D:playertextid;
   new Float:X, Float:Y, Float:Z;
   new string[128];
   if(!strlen(params)) return SendClientMessage(playerid, 0x00FFFFFF, \"Használat: /smtl <szöveg>\");
   GetPlayerPos( playerid, X, Y, Z );
   else
   {
       playertextid = CreatePlayer3DTextLabel(playerid,X,Y,Z,40.0);
       format(string,sizeof(string),\"{F216FA}Kiraktál egy{00EEFF}szöveget a {FAD900}fölé: {00FF88}%s\");
       SendClientMessage(playerid, 0x00FFFFFF, string);
       PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
   }
   return 1;
}

 
Köszönöm
« Utoljára szerkesztve: 2011. Április 20. - 19:51:09 írta kadaradam »

3D text a játékos feje fölött
« Válasz #1 Dátum: 2011. Április 20. - 20:12:01 »
0 Show voters

Nem elérhető Csabesz

  • 7827
    • Profil megtekintése
3D text a játékos feje fölött
« Válasz #2 Dátum: 2011. Április 20. - 20:16:08 »
0 Show voters
Talán..:
 

dcmd_smtl( playerid, params[ ] )
{
   new string[ 128 ];
   if( sscanf( params, \"s[128]\", string ) ) return SendClientMessage( playerid, 0x00FFFFFF, \"Használat: /smtl <szöveg>\" );
   {
       new PlayerText3D:i_Text;
       new Float:X, Float:Y, Float:Z;
       GetPlayerPos( playerid, X, Y, Z );
       format( string, 128,\"{F216FA}Kiraktál egy{00EEFF}szöveget a {FAD900}fölé: {00FF88}%s\", string );
       i_Text = CreatePlayer3DTextLabel( playerid, string, 0x008080FF, X, Y ,Z, 40.0 );
       Attach3DTextLabelToPlayer( i_Text, playerid, 0.0, 0.0, 0.7 );
       PlayerPlaySound( playerid, 1133, 0.0, 0.0, 0.0 );
   }
   return 1;
}
« Utoljára szerkesztve: 2011. Április 20. - 20:19:19 írta SticK »

3D text a játékos feje fölött
« Válasz #3 Dátum: 2011. Április 20. - 20:19:00 »
0 Show voters
Idézetet írta: Stricica date=1303323121\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"7623\" data-ipsquote-contentclass=\"forums_Topic
Attach3DTextLabelToPlayer
 
Nem konkrétan erre gondoltam !
Ezt én is tudom!
De én azt szeretném,hogy ha beírja a /smtl paracsot és hozzá ír valamit,akkor az jelenik meg a player feje fölött.



Talán..:
 

dcmd_smtl( playerid, params[ ] )
{
   new string[ 128 ];
   if( sscanf( params, \"s[128]\", string ) ) return SendClientMessage( playerid, 0x00FFFFFF, \"Használat: /smtl <szöveg>\" );
   {
       new PlayerText3D:i_Text;
       new Float:X, Float:Y, Float:Z;
       GetPlayerPos( playerid, X, Y, Z );
       format( string, 128,\"{F216FA}Kiraktál egy{00EEFF}szöveget a {FAD900}fölé: {00FF88}%s\", string );
       i_Text = CreatePlayer3DTextLabel( playerid, string, 0x008080FF, X, Y ,Z, 40.0 );
       Attach3DTextLabelToPlayer( i_Text, playerid, 0.0, 0.0, 0.7 );
       PlayerPlaySound( playerid, 1133, 0.0, 0.0, 0.0 );
   }
   return 1;
}

 

[/quote]
Köszi,de kidob 2 error-t!
 
C:\\Users\\Atar\\Desktop\\próba.pwn(59) : error 029: invalid expression, assumed zero
C:\\Users\\Atar\\Desktop\\próba.pwn(61) : error 035: argument type mismatch (argument 2)
C:\\Users\\Atar\\Desktop\\próba.pwn(61) : warning 204: symbol is assigned a value that is never used: \"playertextid\"
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase
 
2 Errors.

 
59. sor:else
61.sor:
playertextid = CreatePlayer3DTextLabel(playerid,X,Y,Z,40.0);

 
SticK: Duplapost! Ha már tudtad az elõzõt szerkeszteni, akkor ezt miért nem oda írtad?  :-\\
« Utoljára szerkesztve: 2011. Április 20. - 20:37:33 írta SticK »

Nem elérhető Csabesz

  • 7827
    • Profil megtekintése
3D text a játékos feje fölött
« Válasz #4 Dátum: 2011. Április 20. - 20:39:38 »
0 Show voters
Idézetet írta: kadaradam date=1303323540\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"7623\" data-ipsquote-contentclass=\"forums_Topic

C:\\Users\\Atar\\Desktop\\próba.pwn(59) : error 029: invalid expression, assumed zero
C:\\Users\\Atar\\Desktop\\próba.pwn(61) : error 035: argument type mismatch (argument 2)
C:\\Users\\Atar\\Desktop\\próba.pwn(61) : warning 204: symbol is assigned a value that is never used: \"playertextid\"
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.

 
59. sor:else
61.sor:
playertextid = CreatePlayer3DTextLabel(playerid,X,Y,Z,40.0);

 

Hát az én kódomba egyik sor sem létezik. Az egészet másold be és úgy próbáld...

3D text a játékos feje fölött
« Válasz #5 Dátum: 2011. Április 20. - 20:44:45 »
0 Show voters

Hát az én kódomba egyik sor sem létezik. Az egészet másold be és úgy próbáld...[/quote]
 
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == \'\\0\') && (dcmd_%1(playerid, \"\"))) || (((%3)[(%2) + 1] == \' \') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Blank Filterscript by your name here\");
print(\"--------------------------------------\\n\");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print(\"\\n----------------------------------\");
print(\" Blank Gamemode by your name here\");
print(\"----------------------------------\\n\");
}
#endif
public OnGameModeInit()
{
// Don\'t use these lines if it\'s a filterscript
SetGameModeText(\"Blank Script\");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(smtl,5,cmdtext);
return 0;
}
dcmd_smtl(playerid,params[])
{
   new PlayerText3D:playertextid;
   new Float:X, Float:Y, Float:Z;
   new string[128];
   if(!strlen(params)) return SendClientMessage(playerid, 0x00FFFFFF, \"Használat: /smtl <szöveg>\");
   GetPlayerPos( playerid, X, Y, Z );
   else
   {
       playertextid = CreatePlayer3DTextLabel(playerid,X,Y,Z,40.0);
       format(string,sizeof(string),\"{F216FA}Kiraktál egy{00EEFF}szöveget a {FAD900}fölé: {00FF88}%s\");
       SendClientMessage(playerid, 0x00FFFFFF, string);
       PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
   }
   return 1;
}

 
OFF:Bocsi a duplapostért ,csak olyan lassú a fórum,hogy mire megírom a választ addigra már küldenek egy újabbat,és nem néztem meg,hogy én írtam-e utoljára.

Nem elérhető Csabesz

  • 7827
    • Profil megtekintése
3D text a játékos feje fölött
« Válasz #6 Dátum: 2011. Április 20. - 20:47:48 »
0 Show voters
Idézetet írta: kadaradam date=1303325085\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"7623\" data-ipsquote-contentclass=\"forums_Topic


Hát az én kódomba egyik sor sem létezik. Az egészet másold be és úgy próbáld...

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == \'\\0\') && (dcmd_%1(playerid, \"\"))) || (((%3)[(%2) + 1] == \' \') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Blank Filterscript by your name here\");
print(\"--------------------------------------\\n\");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print(\"\\n----------------------------------\");
print(\" Blank Gamemode by your name here\");
print(\"----------------------------------\\n\");
}
#endif
public OnGameModeInit()
{
// Don\'t use these lines if it\'s a filterscript
SetGameModeText(\"Blank Script\");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(smtl,5,cmdtext);
return 0;
}
dcmd_smtl(playerid,params[])
{
   new PlayerText3D:playertextid;
   new Float:X, Float:Y, Float:Z;
   new string[128];
   if(!strlen(params)) return SendClientMessage(playerid, 0x00FFFFFF, \"Használat: /smtl <szöveg>\");
   GetPlayerPos( playerid, X, Y, Z );
   else
   {
       playertextid = CreatePlayer3DTextLabel(playerid,X,Y,Z,40.0);
       format(string,sizeof(string),\"{F216FA}Kiraktál egy{00EEFF}szöveget a {FAD900}fölé: {00FF88}%s\");
       SendClientMessage(playerid, 0x00FFFFFF, string);
       PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
   }
   return 1;
}

 
OFF:Bocsi a duplapostért ,csak olyan lassú a fórum,hogy mire megírom a választ addigra már küldenek egy újabbat,és nem néztem meg,hogy én írtam-e utoljára.
 
[/quote]
Ezt nem én írtam  :amazed:
Ezt írtam én:
 

Talán..:
 

dcmd_smtl( playerid, params[ ] )
{
   new string[ 128 ];
   if( sscanf( params, \"s[128]\", string ) ) return SendClientMessage( playerid, 0x00FFFFFF, \"Használat: /smtl <szöveg>\" );
   {
       new PlayerText3D:i_Text;
       new Float:X, Float:Y, Float:Z;
       GetPlayerPos( playerid, X, Y, Z );
       format( string, 128,\"{F216FA}Kiraktál egy{00EEFF}szöveget a {FAD900}fölé: {00FF88}%s\", string );
       i_Text = CreatePlayer3DTextLabel( playerid, string, 0x008080FF, X, Y ,Z, 40.0 );
       Attach3DTextLabelToPlayer( i_Text, playerid, 0.0, 0.0, 0.7 );
       PlayerPlaySound( playerid, 1133, 0.0, 0.0, 0.0 );
   }
   return 1;
}

 

[/quote]

3D text a játékos feje fölött
« Válasz #7 Dátum: 2011. Április 20. - 21:12:02 »
0 Show voters
Idézetet írta: SticK date=1303325268\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"7623\" data-ipsquote-contentclass=\"forums_Topic


 

Hát az én kódomba egyik sor sem létezik. Az egészet másold be és úgy próbáld...

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == \'\\0\') && (dcmd_%1(playerid, \"\"))) || (((%3)[(%2) + 1] == \' \') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Blank Filterscript by your name here\");
print(\"--------------------------------------\\n\");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print(\"\\n----------------------------------\");
print(\" Blank Gamemode by your name here\");
print(\"----------------------------------\\n\");
}
#endif
public OnGameModeInit()
{
// Don\'t use these lines if it\'s a filterscript
SetGameModeText(\"Blank Script\");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(smtl,5,cmdtext);
return 0;
}
dcmd_smtl(playerid,params[])
{
   new PlayerText3D:playertextid;
   new Float:X, Float:Y, Float:Z;
   new string[128];
   if(!strlen(params)) return SendClientMessage(playerid, 0x00FFFFFF, \"Használat: /smtl <szöveg>\");
   GetPlayerPos( playerid, X, Y, Z );
   else
   {
       playertextid = CreatePlayer3DTextLabel(playerid,X,Y,Z,40.0);
       format(string,sizeof(string),\"{F216FA}Kiraktál egy{00EEFF}szöveget a {FAD900}fölé: {00FF88}%s\");
       SendClientMessage(playerid, 0x00FFFFFF, string);
       PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
   }
   return 1;
}

 
OFF:Bocsi a duplapostért ,csak olyan lassú a fórum,hogy mire megírom a választ addigra már küldenek egy újabbat,és nem néztem meg,hogy én írtam-e utoljára.
 
[/quote]
Ezt nem én írtam  :amazed:
Ezt írtam én:
 

Talán..:
 

dcmd_smtl( playerid, params[ ] )
{
   new string[ 128 ];
   if( sscanf( params, \"s[128]\", string ) ) return SendClientMessage( playerid, 0x00FFFFFF, \"Használat: /smtl <szöveg>\" );
   {
       new PlayerText3D:i_Text;
       new Float:X, Float:Y, Float:Z;
       GetPlayerPos( playerid, X, Y, Z );
       format( string, 128,\"{F216FA}Kiraktál egy{00EEFF}szöveget a {FAD900}fölé: {00FF88}%s\", string );
       i_Text = CreatePlayer3DTextLabel( playerid, string, 0x008080FF, X, Y ,Z, 40.0 );
       Attach3DTextLabelToPlayer( i_Text, playerid, 0.0, 0.0, 0.7 );
       PlayerPlaySound( playerid, 1133, 0.0, 0.0, 0.0 );
   }
   return 1;
}

 

[/quote]
 
[/quote]
Akkor valamit nagyon elnéztem a beillesztésnél :D
De nem jó valami,kidob egy warningot és az FS-t nem lehet betölteni.
Hiba:
 
C:\\Users\\Atar\\Desktop\\próba.pwn(63) : warning 213: tag mismatch

 
63.sor tartalma:Attach3DTextLabelToPlayer( i_Text, playerid, 0.0, 0.0, 0.7 );

Nem elérhető Iceaac

  • 2187
    • Profil megtekintése
3D text a játékos feje fölött
« Válasz #8 Dátum: 2011. Április 20. - 22:24:43 »
0 Show voters
new PlayerText3D:i_Text;

 
csere
 
new Text3D:i_Text;

3D text a játékos feje fölött
« Válasz #9 Dátum: 2011. Április 22. - 22:05:26 »
0 Show voters
Kösz Iceaac ,de nem jó. :(
 
C:\\Users\\Atar\\Desktop\\próba.pwn(62) : warning 213: tag mismatch
C:\\Users\\Atar\\Desktop\\próba.pwn(63) : warning 213: tag mismatch
C:\\Users\\Atar\\Desktop\\próba.pwn(63) : warning 213: tag mismatch
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase
 
3 Warnings.

 
DE kitaláltam egy másik megoldást:
 
dcmd_smtl( playerid, params[ ], text[])
{
   new string[ 128 ];
   if( sscanf( params, \"s[128]\", string ) ) return SendClientMessage( playerid, 0x00FFFFFF, \"Használat: /smtl <szöveg>\" );
   {
       SetPlayerChatBubble(playerid,text,0x008000FF,35.0,10000); //(10mp)
       format( string, 128,\"{F216FA}Kiraktál egy{00EEFF}szöveget a {FAD900}fölé: {00FF88}%s\", string );
       PlayerPlaySound( playerid, 1133, 0.0, 0.0, 0.0 );
   }
   return 1;
}

 
De így is kidob 2 warningot:
 
C:\\Users\\Atar\\Desktop\\próba másolata.pwn(49) : warning 202: number of arguments does not match definition
C:\\Users\\Atar\\Desktop\\próba másolata.pwn(49) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase
 
2 Warnings.

 
49.sor:dcmd(smtl,5,cmdtext);

Nem elérhető Csabesz

  • 7827
    • Profil megtekintése
3D text a játékos feje fölött
« Válasz #10 Dátum: 2011. Április 22. - 22:14:51 »
0 Show voters
dcmd_smtl( playerid, params[ ] )
{
   new string[ 128 ];
   if( sscanf( params, \"s[128]\", string ) ) return SendClientMessage( playerid, 0x00FFFFFF, \"Használat: /smtl <szöveg>\" );
   {
       SetPlayerChatBubble(playerid,string,0x008000FF,35.0,10000); //(10mp)
       format( string, 128,\"{F216FA}Kiraktál egy{00EEFF}szöveget a {FAD900}fölé: {00FF88}%s\", string );
       SendClientMessage( playerid, 0x0000FF, string );
       PlayerPlaySound( playerid, 1133, 0.0, 0.0, 0.0 );
   }
   return 1;
}

3D text a játékos feje fölött
« Válasz #11 Dátum: 2011. Április 22. - 22:22:17 »
0 Show voters
Idézetet írta: SticK date=1303503291\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"7623\" data-ipsquote-contentclass=\"forums_Topic

dcmd_smtl( playerid, params[ ] )
{
   new string[ 128 ];
   if( sscanf( params, \"s[128]\", string ) ) return SendClientMessage( playerid, 0x00FFFFFF, \"Használat: /smtl <szöveg>\" );
   {
       SetPlayerChatBubble(playerid,string,0x008000FF,35.0,10000); //(10mp)
       format( string, 128,\"{F216FA}Kiraktál egy{00EEFF}szöveget a {FAD900}fölé: {00FF88}%s\", string );
       SendClientMessage( playerid, 0x0000FF, string );
       PlayerPlaySound( playerid, 1133, 0.0, 0.0, 0.0 );
   }
   return 1;
}

 

f***a,köszi.
Majd holnap letesztelem,mert már nincs kedvem 22:22-kor playerekt hívni.
Addig is nyitvahagyom a témát.
_____________________________________________________________________________________
Nemjó,Server Unoknown Command-t ír ki.
« Utoljára szerkesztve: 2011. Április 23. - 09:58:44 írta kadaradam »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal