ZCMD parancsfeldolgozót használtam.
#include a_samp
#include zcmd
#include sscanf
new szoveg[MAX_PLAYERS], Text3D:polo[MAX_PLAYERS];
CMD:poloszoveg(playerid, params[])
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(sscanf(params, \"s\", szoveg[playerid])) return SendClientMessage(playerid, 0xFFFFAAAA, \"Használat: /poloszoveg [szoveg]\");
polo[playerid] = Create3DTextLabel(\"\", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(polo[playerid], playerid, 0.0, 0.0, 0.7);
Update3DTextLabelText(polo[playerid], 0x008080FF, szoveg);
return 1;
}
CMD:poloszovegle(playerid, params[])
{
Update3DTextLabelText(polo[playerid], 0xFFFFFFFF, \"\");
return 1;
}
Jó, hogy nem mûködik. Rengeteg hibát ejtettem. Nem volt kéznél pawno. Javítom, pillanat.
Kijavítottam. Egy-két változót kiszedtem, fölöslegesnek tartottam.
#include a_samp
#include zcmd
#include sscanf
new szoveg[MAX_PLAYERS], Text3D:polo[MAX_PLAYERS];
CMD:poloszoveg(playerid, params[])
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(sscanf(params, \"s\", szoveg[playerid])) return SendClientMessage(playerid, 0xFFFFAAAA, \"Használat: /poloszoveg [szoveg]\");
polo[playerid] = Create3DTextLabel(\"\", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(polo[playerid], playerid, 0.0, 0.0, 0.7);
Update3DTextLabelText(polo[playerid], 0x008080FF, szoveg);
return 1;
}
CMD:poloszovegle(playerid, params[])
{
Update3DTextLabelText(polo[playerid], 0xFFFFFFFF, \"\");
return 1;
}