Attachlabel
#1

PHP код:
COMMAND:label(playeridparams[])
{
    if (
playerData[playerid][playerLoggedIn])
    {
        if(
playerData[playerid][HasCustomLable])
        {
            new 
value[25];
            if(
sscanf(params"s"value))
            {
                return 
SendClientMessage(playeridCOLOR_WHITE"{B7B7B7}[SERVER] {FFFF00}Usage: \"lable TEXT [COST = 4000XP]\"");
            }
            else
            {
                if (
playerData[playerid][playerXP] >= 4000)
                {
                    if(
strlen(value) < 16)
                    {
                        
playerGiveXP(playerid, -4000);
                        
playerData[playerid][CustomLabel] = Create3DTextLabel("%s"0xFFDC2EFF30.040.050.060.0, -11value);
                        
Attach3DTextLabelToPlayer(playerData[playerid][CustomLabel], playerid0.00.00.4);
                        
playerData[playerid][HasCustomLable] = true;
                    }
                }
            }
        }
        else if(
playerData[playerid][HasCustomLable] == false)
            {
                
Delete3DTextLabel(playerData[playerid][CustomLabel]);
                
SendClientMessage(playerid, -1"Lable has been removed!");
            }
    }        
    return 
1;

.../cnr_commands.inc(2603) : warning 202: number of arguments does not match definition

line 2603:
playerData[playerid][CustomLabel] = Create3DTextLabel("%s", 0xFFDC2EFF, 30.0, 40.0, 50.0, 60.0, -1, 1, value);
Reply
#2

try this

Код HTML:
playerData[playerid][CustomLabel] = Create3DTextLabel("%s, 40.0, 50.0", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, 0);
Reply
#3

That %s needs something bruh....
Reply
#4

put after last 0, value

like this

Код HTML:
playerData[playerid][CustomLabel] = Create3DTextLabel("%s, 40.0, 50.0", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, 0, value);
Reply
#5

... you what... the line that gives me warning is same as you printed in post above :3
Reply
#6

Why would you want to pass another argument (which is not format to begin with) to the function? value is already string. You don't need sscanf either (you have used it wrong too because "s" specifier needs length in [] next to it).

pawn Код:
if (isnull(params)) return ... // usage
in strlen function you replace value with params and last:
pawn Код:
playerData[playerid][CustomLabel] = Create3DTextLabel(params, 0xFFDC2EFF, 30.0, 40.0, 50.0, 60.0, -1, 1);
Reply
#7

I see you're promoting usage of (isnull(params) for single vars... How come BTW?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)