SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 21/01/2014, 08:36 PM   #1
nguyenquynh
Banned
 
Join Date: Sep 2012
Posts: 94
Reputation: 0
Default Please view it

I have create command giftcode is


Code:
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

Code:
FFFDSAA
DDADFAA
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.
nguyenquynh is offline   Reply With Quote
Old 21/01/2014, 09:53 PM   #2
nguyenquynh
Banned
 
Join Date: Sep 2012
Posts: 94
Reputation: 0
Default Re: Please view it

upppppppp
nguyenquynh is offline   Reply With Quote
Old 22/01/2014, 01:44 AM   #3
niconhan
Big Clucker
 
niconhan's Avatar
 
Join Date: Sep 2012
Location: Vietnamese
Posts: 83
Reputation: 0
Default Re: Please view it

Why not use mysql?
__________________
http://********.com/gtaviet ~ Vietnamese Grand Theft Auto Page
niconhan is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why when attaching some objects above vehicles, cause the camera view to view the object close up? Donya Help Archive 2 18/05/2011 12:34 AM
What's your view? Ashley Everything and Nothing 3 23/04/2011 02:16 AM
Help a view Mechscape Help Archive 7 07/11/2009 08:14 PM
right view nesty Help Archive 2 12/07/2009 12:02 AM


All times are GMT. The time now is 06:01 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.