announce;notice help
#1

hello, i have a little problem with my created command.
pawn Код:
if(!strcmp(cmd, "/notice"))
  {
  if(GetPlayerScore(playerid) >= 18)
  {
  new text[128];
  {
  if(sscanf(cmds, "s[128]",text)) return SendClientMessage(playerid, 0xFFFFFFFF, "Lietojums: /notice [text]");
  {
  new string[128];
  new pName[128];
  GetPlayerName(playerid,pName,128);
  format(string,sizeof string,"Spēlētāja %s paziņojums: %s",pName,text);
  SendClientMessageToAll(0xA10000AA,string);
  return 1;
  }
  }
  }
    else
  {
      SendClientMessage(playerid,0xC0C0C0C8,"Tev vajadzīgs 18. Līmenis lai lietotu љo komandu!");
  }
     return 1;
   }
When i type /notice text, it just gives me: Lietojums: /notice [text](Lietojums-Usage)
Can somebody please edit for me? thanks
Reply
#2

Try it

Код:
if(!strcmp(cmd, "/notice")) {
  if(GetPlayerScore(playerid) >= 18) {
	  new text[128];
	  if(sscanf(cmd, "s[128]",text)) return SendClientMessage(playerid, 0xFFFFFFFF, "Lietojums: /notice [text]");
	  new string[128];
	  new pName[128];
	  GetPlayerName(playerid,pName,128);
	  format(string,sizeof string,"Spēlētāja %s paziņojums: %s",pName,text);
	  return SendClientMessageToAll(0xA10000AA,string);
  }
  return SendClientMessage(playerid,0xC0C0C0C8,"Tev vajadzīgs 18. Līmenis lai lietotu šo komandu!");
}
Reply
#3

Quote:
Originally Posted by Joao Pedro
Посмотреть сообщение
Try it

Код:
if(!strcmp(cmd, "/notice")) {
  if(GetPlayerScore(playerid) >= 18) {
	  new text[128];
	  if(sscanf(cmd, "s[128]",text)) return SendClientMessage(playerid, 0xFFFFFFFF, "Lietojums: /notice [text]");
	  new string[128];
	  new pName[128];
	  GetPlayerName(playerid,pName,128);
	  format(string,sizeof string,"Spēlētāja %s paziņojums: %s",pName,text);
	  return SendClientMessageToAll(0xA10000AA,string);
  }
  return SendClientMessage(playerid,0xC0C0C0C8,"Tev vajadzīgs 18. Līmenis lai lietotu љo komandu!");
}
same :/
Reply
#4

Try:

Код:
if(!strcmp(cmd, "/notice")) {
  if(GetPlayerScore(playerid) >= 18) {
	  new text[128], arguments[32];
	  strmid(arguments, cmd, 8, sizeof(cmd)); 
	  if(sscanf(arguments, "s[128]",text)) return SendClientMessage(playerid, 0xFFFFFFFF, "Lietojums: /notice [text]");
	  new string[128];
	  new pName[128];
	  GetPlayerName(playerid,pName,128);
	  format(string,sizeof string,"Spēlētāja %s paziņojums: %s",pName,text);
	  return SendClientMessageToAll(0xA10000AA,string);
  }
  return SendClientMessage(playerid,0xC0C0C0C8,"Tev vajadzīgs 18. Līmenis lai lietotu šo komandu!");
}
Reply
#5

Fixed myself, but thanks for help!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)