[Off] Qual melhor modo de uso???
#1

Qual melhor modo de uso destes 2 exemplos

Код:
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;
}
Abraзos
Reply


Messages In This Thread
Qual melhor modo de uso??? - by @LucasVinicius - 21.04.2013, 17:00
Re: Qual melhor modo de uso??? - by iHarzard - 21.04.2013, 17:02
Re: Qual melhor modo de uso??? - by Gleisson_. - 21.04.2013, 17:03
Re: Qual melhor modo de uso??? - by @LucasVinicius - 21.04.2013, 17:06
Re: Qual melhor modo de uso??? - by Gii - 21.04.2013, 17:11

Forum Jump:


Users browsing this thread: 1 Guest(s)