21.01.2014, 20:36
I have create command giftcode is
File GIFTCODE.TXT in /scriptfiles
I have created one file in / filescript is giftcode.txt, I want the players to get their code to use / giftcode FDD00032SA, they ll get money and level but the import is completed in 1 file will delete that code and when they enter the code if the code does not exist, it will be reported as "your code entered is invalid". please help me finish it, thanks very much
Wishing everyone a happy 2014 and happy.
Sorry english bad.
Код:
CMD:giftcode(playerid, params[]) { new string[100]; if(IsPlayerConnected(playerid)) { if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "SUDUNG: /giftcode [Number Code]"); { new File:example = fopen("/GIFTCODE.txt", io_read); while(fread(example, string)) { if(strcmp(string, "FDD00032SA", true) != -1 || strcmp(string, "FFDS3300LA", true) != -1) { GivePlayerMoney(playerid, +200000); PlayerInfo[playerid][pLevel] += 2; fremove(string); fclose(example); return 1; } } } return 1; } return 1; }
Код:
FFFDSAA DDADFAA
Wishing everyone a happy 2014 and happy.
Sorry english bad.