SERVER: Unknown Command.
#1

when i type the command in my server /points the command works perfect but i get SERVER:Unknown command immidiatley after:


HERES THE CODE

Код:
dcmd_points(playerid, params[])
{
    #pragma unused params
  if(logged[playerid] == 1)
  {
 	new file[128], pname[MAX_PLAYER_NAME];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(file, sizeof(file), "\\Users\\%s.ini", pname);
  dini_IntSet(file, "serverpoints", serverpoints[playerid]);
  new str[128]; format(str, sizeof(str), "You currently have %d Server Points", serverpoints[playerid]);
  SendClientMessage(playerid, COLOR_YELLOW, str);
  SendClientMessage(playerid, red, "Type /spendpoints to find out what you can use you're points on!");
  }
		else {
		SendClientMessage(playerid, red, "Error: You need to be logged in to see you're server points!.");
		}
}
Reply
#2

return 1; before the last bracket.
Reply
#3

i did that but i got a shit load of errors.
Reply
#4

Код:
dcmd_points(playerid, params[])
{
    #pragma unused params
  if(logged[playerid] == 1)
  {
 	new file[128], pname[MAX_PLAYER_NAME];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(file, sizeof(file), "\\Users\\%s.ini", pname);
  dini_IntSet(file, "serverpoints", serverpoints[playerid]);
  new str[128]; format(str, sizeof(str), "You currently have %d Server Points", serverpoints[playerid]);
  SendClientMessage(playerid, COLOR_YELLOW, str);
  SendClientMessage(playerid, red, "Type /spendpoints to find out what you can use you're points on!");
  }
		else {
		SendClientMessage(playerid, red, "Error: You need to be logged in to see you're server points!.");
		}
return 1;
}
i told you this on xfire >.>
Reply
#5

iv told u dude i get errors were ever i put the return 1; :@ i just keep getting loose indent but iv tryed it everywere
Reply
#6

pawn Код:
dcmd_points(playerid, params[])
{
    #pragma unused params
    if(logged[playerid] == 1)
    {
      new file[128], pname[MAX_PLAYER_NAME];
      GetPlayerName(playerid, pname, sizeof(pname));
      format(file, sizeof(file), "\\Users\\%s.ini", pname);
      dini_IntSet(file, "serverpoints", serverpoints[playerid]);
      new str[128]; format(str, sizeof(str), "You currently have %d Server Points", serverpoints[playerid]);
      SendClientMessage(playerid, COLOR_YELLOW, str);
      SendClientMessage(playerid, red, "Type /spendpoints to find out what you can use you're points on!");
    }
    else
    {
        SendClientMessage(playerid, red, "Error: You need to be logged in to see you're server points!.");
    }
    return 1;
}
indentation warnings are just warnings, the script should work fine either way.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)