Help In Function
#1

pawn Код:
stock Rank(playerid)
{
    new Rankk[120];
    switch(GetPlayerScore(playerid))
    {
        case 0..10: Rankk = "Ex";
        case 10..50: Rankk = "Ex1";
        case 100..200: Rankk= "Ex2";
        case 200..300: Rankk = "Ex3";
        case 300..599: Rankk = "Ex4";
        default: Rankk = "Ex5";
    }
    return Rankk;
}
Example:

pawn Код:
CMD:rank2(playerid, params[])
{
        new string[128];
        format(string, sizeof(string),"Rank Test:%s",Rank(playerid));
        SendClientMessage(RED,playerid,string);
        return 1;
}
Error:
Код:
(208) : error 040: duplicate "case" label (value 10)
(210) : error 040: duplicate "case" label (value 200)
(211) : error 040: duplicate "case" label (value 300)
Reply
#2

You can't write same values on a different case;
pawn Код:
stock Rank(playerid)
{
    new Rankk[120];
    switch(GetPlayerScore(playerid))
    {
        case 0..10: Rankk = "Ex";
        case 11..50: Rankk = "Ex1";
        case 100..200: Rankk= "Ex2";
        case 201..300: Rankk = "Ex3";
        case 301..599: Rankk = "Ex4";
        default: Rankk = "Ex5";
    }
    return Rankk;
}
Reply
#3

It doesnt send the message
Reply
#4

What it does once you type the command?
Reply
#5

Nothing no message nothing pretty weird :S
Reply
#6

Код:
CMD:rank2(playerid, params[])
{
        new string[128];
        format(string, sizeof(string),"Rank Test:%s",Rank(playerid));
        SendClientMessage(playerid,RED,string);
        return 1;
}
You mixed up the color parameter with the playerid
Reply
#7

Quote:
Originally Posted by johnnyman1
Посмотреть сообщение
Код:
CMD:rank2(playerid, params[])
{
        new string[128];
        format(string, sizeof(string),"Rank Test:%s",Rank(playerid));
        SendClientMessage(playerid,RED,string);
        return 1;
}
You mixed up the color parameter with the playerid
Wow, nice eye!

I can't understand how exactly this doesn't give you an error
pawn Код:
SendClientMessage(RED,playerid,string);
Reply
#8

-.- Thats just a stupid mistake -.- Anyways thanks its sending message know.

EDIT:

pawn Код:
SendClientMessage(RED,playerid,string);
[/QUOTE]

Yea that confuses me a lot -.-
Reply
#9

1 more help i want to attach Rank(playerid)

pawn Код:
new Text3D:label = Create3DTextLabel("",WHITE,30.0, 40.0, 50.0, 40.0, 0);
    Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.4);
To this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)