Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×
  • 0

Textul nu mai apare atunci cand este atasat


Question

Posted

Salut :) Ok, deci am codul acesta:

if(strcmp(cmd, "/setepithet") == 0)
	{
	    if(IsPlayerConnected(playerid))
	        {
	            if(PlayerInfo[playerid][pEpiPoints] >= 1)
	                {
                     	for(new i = 0; i < MAX_PLAYERS; i++)
						{
							if(IsPlayerConnected(i))
								{
            						new PlayerText3D:playertextid;
         							GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
									GetPlayerName(playerid, sendername, sizeof(sendername));
									new length = strlen(cmdtext);
									while ((idx < length) && (cmdtext[idx] <= ' '))
									{
										idx++;
									}
									new offset = idx;
									new result[64];
									while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
									{
										result[idx - offset] = cmdtext[idx];
										idx++;
									}
									result[idx - offset] = EOS;
									if(!strlen(result))
									{
										SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setepithet [string]");
										return 1;
									}
					    			new Float:X, Float:Y, Float:Z;
					    			format(string, sizeof(string), "%s", (result));
									PlayerInfo[playerid][pEpi]=string;
									GetPlayerPos( playerid, X, Y, Z );
         							playertextid = CreatePlayer3DTextLabel(playerid,string,0xa9c4e4FF,X,Y,Z+0.1,20.0);
									PlayerInfo[playerid][pEpiPoints]-=1;
									PlayerInfo[playerid][pEpiON] = 1;
									return 1;
								}
						}
					}
			}
	}
Totul merge perfect. 3DTextLabel-ul apare, dar ramane in locul X,Y,Z, adica nu este atasat de jucator. Deci, am incercat sa fac asta:
if(strcmp(cmd, "/setepithet") == 0)
	{
	    if(IsPlayerConnected(playerid))
	        {
	            if(PlayerInfo[playerid][pEpiPoints] >= 1)
	                {
                     	for(new i = 0; i < MAX_PLAYERS; i++)
						{
							if(IsPlayerConnected(i))
								{
            						new PlayerText3D:playertextid;
         							GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
									GetPlayerName(playerid, sendername, sizeof(sendername));
									new length = strlen(cmdtext);
									while ((idx < length) && (cmdtext[idx] <= ' '))
									{
										idx++;
									}
									new offset = idx;
									new result[64];
									while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
									{
										result[idx - offset] = cmdtext[idx];
										idx++;
									}
									result[idx - offset] = EOS;
									if(!strlen(result))
									{
										SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setepithet [string]");
										return 1;
									}
					    			new Float:X, Float:Y, Float:Z;
					    			format(string, sizeof(string), "%s", (result));
									PlayerInfo[playerid][pEpi]=string;
									GetPlayerPos( playerid, X, Y, Z );
         							playertextid = CreatePlayer3DTextLabel(playerid,string,0xa9c4e4FF,X,Y,Z+0.1,20.0[b],playerid[/b]);
									PlayerInfo[playerid][pEpiPoints]-=1;
									PlayerInfo[playerid][pEpiON] = 1;
									return 1;
								}
						}
					}
			}
	}

Textul nu este atasat de jucator, iar acesta nici macar nu mai apare acum.

Ce pot face?

2 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.