#1

instead of showing the UsageMessage, the command returns 0. I've never done multiple strings in one command before

pawn Код:
CMD:anim(playerid, params[])
{
    new lib[100], anim[100];
    if(sscanf(params, "s[100]s[100]", lib, anim)) return UsageMessage(pid, "/anim [library][anim]");
    ApplyAnimation(playerid, lib, anim, 4.1, 1, 1, 1, 1, 1, 1);
    return 1;
}
its to test animations btw
Reply
#2

You mean like this?
pawn Код:
CMD:anim(playerid, params[]) // Made by Wizza
{
    new lib;
    if(sscanf(params, "i", animid)) return SendClientMessage(playerid, COLOR_WHITE, "/anim [library][anim]");
    if(lib< 1 || lib> 2) return SendClientMessage(playerid, COLOR_WHITE, "Library is between 1-2");
    switch(lib)
    {
        case 1: ApplyAnimation(playerid,"BEACH","bather",4.0,1,0,0,0,0);
        case 2: Different anim here
    }
    return 1;
}
Reply
#3

no. I want to test animations, so you would type /anim [library][animname] and it applies it.
Reply
#4

Using more than 1 string is messed up. I'd use it as:
pawn Код:
CMD:anim(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, -1, "/anim [library,anim]");
    new lib[15], anim[30];
    sscanf(params, "p<,>s[15]s[30]", lib, anim);
    ApplyAnimation(playerid, lib, anim, 4.1, 1, 1, 1, 1, 1, 1);
    return 1;
}
But you should separate the two strings with a comma: /anim PED,WALK_DRUNK
Reply
#5

you know..it really helps when your amx is in the gamemodes after compiling. q.q
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)