Please view it - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Please view it (
/showthread.php?tid=489304)
Please view it -
nguyenquynh - 21.01.2014
I have create command giftcode is
Код:
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;
}
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.
Re: Please view it -
nguyenquynh - 21.01.2014
upppppppp
Re: Please view it -
niconhan - 22.01.2014
Why not use mysql?