-
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
-
Attach3DTextLabelToPlayer
-
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;
}
-
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? :-\\
-
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...
-
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.
-
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]
-
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 );
-
new PlayerText3D:i_Text;
csere
new Text3D:i_Text;
-
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);
-
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;
}
-
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.