30.04.2010, 21:08
first of, I strongly recommend using zcmd instead. That nifty system is way more efficient than these crappy comparation codes.
then secondly:
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; }