Help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help (
/showthread.php?tid=606815)
Help -
SaiyanZ - 09.05.2016
Hi
PHP код:
CMD:setheadtext(playerid, params[])
{
new targetid, text;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "* You are not Authorized to use this command *");
if(sscanf(params,"ui",targetid, text)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: * {FF0000} /Setheadtext [id] [text]*");
[line 110] new Text3D:label = Create3DTextLabel(text, -1, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label, targetid, 0.0, 0.0, 0.7);
return 1;
}
tried to make this, Is it possible to do like this?
error
Код:
C:\Users\Intel Computers\Desktop\World War Server\filterscripts\Factions.pwn(110) : error 035: argument type mismatch (argument 1)
Re: Help -
TheSimpleGuy - 09.05.2016
Код:
CMD:setheadtext(playerid, params[])
{
new targetid, text[128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "* You are not Authorized to use this command *");
if(sscanf(params,"us[128]",targetid, text)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: * {FF0000} /Setheadtext [id] [text]*");
[line 110] new Text3D:label = Create3DTextLabel(text, -1, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label, targetid, 0.0, 0.0, 0.7);
return 1;
}
Change text variable to string.
Re: Help -
Konstantinos - 09.05.2016
text should be a string (array) and replace "i" specifier in sscanf with "s[SIZE_HERE]".
Re: Help -
oMa37 - 09.05.2016
Try this
PHP код:
CMD:setheadtext(playerid, params[])
{
new targetid, text[128];
new Text3D:label;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "* You are not Authorized to use this command *");
if(sscanf(params,"us[128]",targetid, text)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: * {FF0000} /Setheadtext [id] [text]*");
label = Create3DTextLabel(text, -1, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label, targetid, 0.0, 0.0, 0.7);
return 1;
}