converting to zcmd + sccanf
#1

Код:
    if(strcmp(cmd, "/wankoff", true) == 0) {

		    // Get the dance style param
      		tmp = strtok(cmdtext, idx);
			if(!strlen(tmp)) {
				SendClientMessage(playerid,0xFF0000FF,"Usage: /wankoff [style 1-3]");
				return 1;
			}

			wankstyle = strval(tmp);
			if(wankstyle < 1 || wankstyle > 3) {
			    SendClientMessage(playerid,0xFF0000FF,"Usage: /wankoff [style 1-3]");
			    return 1;
			}

			if(wankstyle == 1) {
 		    ApplyAnimationEx(playerid,"PAULNMAC","wank_in",4.0,1,1,1,1,0);
			} else if(wankstyle == 2) {
		    ApplyAnimationEx(playerid,"PAULNMAC","wank_loop",4.0,1,1,1,1,0);
			} else if(wankstyle == 3) {
			ApplyAnimationEx(playerid,"PAULNMAC","wank_out",4.0,1,1,1,1,0);
			}
 	  		return 1;
		}
I need to convert this to to zcmd + sccanf.. Pls help.. Thanks.
Reply
#2

Simple as 1 2 3.

1) https://sampforum.blast.hk/showthread.php?tid=91354

2) https://sampforum.blast.hk/showthread.php?tid=120356

3)
pawn Код:
CMD:wankoff(playerid, params[])
{
    new wstyle;
    if(!sscanf(params, "i", wstyle))
    {
        if(0 < wstyle < 4)
        {
            new a_lib[32], a_name[32];
            GetAnimationName(991 + wstyle, a_lib, sizeof(a_lib), a_name, sizeof(a_name));
            ApplyAnimationEx(playerid, a_lib, a_name, 4.0, 1, 1, 1, 1, 0);
            return 1;
        }
    }
    return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /wankoff (style 1-3)");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)