Dini Save fonction
#1

Код:
public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(playerid, Textdraw1);
GameTextForPlayer(playerid,"Walkies DeathMatch ~w~Server Scripted by ZheFoxy ",5000,1);

new pName[MAX_PLAYER_NAME];
new string[48];
dini_Get(udb_encode(name), "cash");
dini_Get(udb_encode(name), "gang");
format(string, sizeof(string), "%s has joined the server.", pName);
SendClientMessage(playerid,0xFFFFFFAA,"Welcome to Walkies DeathMatch Created by ZheFoxy");

	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
dini_IntSet(udb_encode(pname), "cash", 9999);
dini_IntSet(udb_encode(pname),  "gang", 1);


	return 1;
}
Код:
C:\Documents and Settings\Administrateur\Bureau\Server Dev\gamemodes\Walkies.pwn(150) : error 017: undefined symbol "udb_encode"
C:\Documents and Settings\Administrateur\Bureau\Server Dev\gamemodes\Walkies.pwn(151) : error 017: undefined symbol "udb_encode"
C:\Documents and Settings\Administrateur\Bureau\Server Dev\gamemodes\Walkies.pwn(155) : warning 217: loose indentation
C:\Documents and Settings\Administrateur\Bureau\Server Dev\gamemodes\Walkies.pwn(160) : error 017: undefined symbol "udb_encode"
C:\Documents and Settings\Administrateur\Bureau\Server Dev\gamemodes\Walkies.pwn(161) : error 017: undefined symbol "udb_encode"
Reply
#2

Код:
dini_IntSet(udb_encode(pname), "cash", 9999);
for what are you using that udb_encode? I'm still a newbie at this but there you should place location of a file you want to save in. Make a string and format it to set the location by the player's name.

Код:
format(name, sizeof(name), "users/%s.ini", Getplayername(playerid, pName, MAX_PLAYER_NAME)
dini_IntSet(name, "cash", 9999);
I'm not sure will this work but it might. As I said, I'm not pro at this, just trying to help xD.
Reply
#3

dude same ERROR
Reply
#4

You need to define it on top of your code
Reply
#5

so what i need define before the fonction or what?
Reply
#6

pawn Код:
new pName[24], file[64];
GetPlayerName(playerid, pName, 24);
format(file, sizeof(file), "accounts/%s.ini", pName); // Or whatever your account file setup is
dini_IntSet(file, "Cash", GetPlayerMoney(playerid)); //Or whatever you intend to do
and define this at the top:

pawn Код:
#include <dudb>
Reply
#7

thnx for this help but i have the 2error C:\Documents and Settings\Administrateur\Bureau\Server Dev\gamemodes\Walkies.pwn(151) : error 017: undefined symbol "name"
C:\Documents and Settings\Administrateur\Bureau\Server Dev\gamemodes\Walkies.pwn(152) : error 017: undefined symbol "name"
Reply
#8

ok i fixed that whit my self

new name[MAX_PLAYER_NAME];

but i have this warnings

Код:
local variable "name" shadows a variable at a preceding level
Reply
#9

nvm, you fixed it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)