#3

first of, I strongly recommend using zcmd instead. That nifty system is way more efficient than these crappy comparation codes.
then secondly:
Код:
new tmp[2];
if(strcmp(cmd, "/cookies", true) == 0)
 {
 if(IsPlayerLuxAdmin(playerid))
  {
  new name[MAX_PLAYER_NAME];
  tmp[0] = strval(strtok(cmdtext, idx));//strval makes possible that only a value is assigned, no strings will be out of the way, retrieve playerid
  tmp[1] = strval(strtok(cmdtext, idx));//strval makes possible that only a value is assigned, no strings will be out of the way, retrieve amount
  if(IsPlayerConnected(tmp[0]))return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /cookies [playerid] [amount]");;//stop code, player not connected
  GetPlayerName(tmp[0], name, sizeof(name));
  if(tmp[1] <= 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /cookies [playerid] [amount]");
  format(file,sizeof(file),"%s.ini",name);
  if(!fexist(file))
   {
   dini_Create(file);
   dini_IntSet(file,"Cookies", tmp[1]);
   }
  }
  }
return 1;
}
Reply


Messages In This Thread
Help - by ViruZZzZ_ChiLLL - 30.04.2010, 20:58
Re: Help - by Dolph - 30.04.2010, 21:01
Re: Help - by maij - 30.04.2010, 21:08

Forum Jump:


Users browsing this thread: 1 Guest(s)