I have little strange question ?
#1

first i wonna give example:i make register/login system on my gamemode and save stuff like ip,name,money,scores and ..... if i make filterscripts for example player to but beer and to save so when player left dont lose his bear so my question is can i make somethin to save his bear(example) like gamemode on 1 txt were is pass,money,scores,and ....
Reply
#2

any anser?
Reply
#3

You can make it like
Код:
PlayerInfo[playerid][pBeer] = 1;
So if he bought the beer, and logged off, he can use (/drinkbeer) to drink it.
Like this:
Код:
	if(strcmp(cmd, "/drinkbeer", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
			if(PlayerInfo[playerid][pBeer] == 1)
			{
			    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
			}
			else
			{
			    SendClientMessage(playerid, 0xAFAFAFAA, "You don't have a beer!");
			}
		}
		return 1;
	}
Reply
#4

beer was example i meen how i can save something when i make on filterscripts to save to scriptfiles were is save on 1 txt file all info for user for example

ip
name
pass
money
scores
beer
so when player buy beer to save here[up]
Reply
#5

Quote:
Originally Posted by doreto
Посмотреть сообщение
beer was example i meen how i can save something when i make on filterscripts to save to scriptfiles were is save on 1 txt file all info for user for example

ip
name
pass
money
scores
beer
so when player buy beer to save here[up]
Well you have a few options open to you. You can just add saving code to every filterscript you use that needs saving (This is pretty easy for most ini systems/mysql), you could use CallRemoteFunction to call a function in your GM to save your data, or you could use PVars which are cross script compatible and just add the pvar "beers" to your main save system.
Reply
#6

Yes, but if you use the FS, you need to save in a n other file. I recommend you to incorporate your beer sysrem on the gamemode, so it will save on the user file of registering system.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)