21.04.2013, 17:00
Qual melhor modo de uso destes 2 exemplos
Abraзos
Код:
YCMD:smoke(playerid, params[],help) { #pragma unused help if(sscanf(params, "s", anims)) { SendClientMessage(playerid, 0x33AA33AA, "Uso correto: /smoke [1-4]"); } else { if(strcmp(anims, "0", true) == 0) { SendClientMessage(playerid, 0x33AA33AA, "Uso correto: /smoke [1-4]"); } if(strcmp(anims, "1", true) == 0) { ApplyAnimation(playerid,"SMOKING", "F_smklean_loop", 4.0, 1, 0, 0, 0, 0); } if(strcmp(anims, "2", true) == 0) { ApplyAnimation(playerid,"SMOKING", "M_smklean_loop", 4.0, 1, 0, 0, 0, 0); } if(strcmp(anims, "3", true) == 0) { ApplyAnimation(playerid,"SMOKING","M_smkstnd_loop", 4.0, 1, 0, 0, 0, 0); } if(strcmp(anims, "4", true) == 0) { ApplyAnimation(playerid,"SMOKING","M_smk_out", 4.0, 1, 0, 0, 0, 0); } } return 1; }
Код:
YCMD:smoke(playerid, params[],help) { #pragma unused help if(sscanf(params,"s", anims)) return SendClientMessage(playerid, 0x33AA33AA, "Uso correto: /smoke [1-4]"); switch(anims) { case 1: ApplyAnimation(playerid,"SMOKING", "F_smklean_loop", 4.0, 1, 0, 0, 0, 0); case 2: ApplyAnimation(playerid,"SMOKING", "M_smklean_loop", 4.0, 1, 0, 0, 0, 0); case 3: ApplyAnimation(playerid,"SMOKING","M_smkstnd_loop", 4.0, 1, 0, 0, 0, 0); case 4: ApplyAnimation(playerid,"SMOKING","M_smk_out", 4.0, 1, 0, 0, 0, 0); } return 1; }