16.08.2010, 11:47
(
Последний раз редактировалось lionlev; 16.08.2010 в 11:58.
)
Hello! I wanted to write some new "Respect" system, but I get some errors... Could you help me with that?
Respect: Just kind of score, but you can trade it for some money or guns...
It's also have auto saver (money, score etc) Please fix that code.
(And explane me what you did)
Respect: Just kind of score, but you can trade it for some money or guns...
Код:
#include <a_samp> #include <Dini> #include <Dutils> #include <Dudb> #pragma unused ret_memcpy forward BuridgeDisconnect(playerid); forward BuridgeConnect(playerid); new pname[MAX_PLAYER_NAME]; new BurridgeScore[100]; new GetPlayerRespect; new SetPlayerRespect; public BuridgeDisconnect(playerid) { GetPlayerName(playerid, pname, sizeof(pname)); format(BurridgeScore, sizeof(BurridgeScore), "/Burridge Saver/%s.ini",pname); if(!dini_Exists(BurridgeScore)) { } else { dini_IntSet(BurridgeScore, "Score", GetPlayerScore(playerid)); dini_IntSet(BurridgeScore, "Money", GetPlayerMoney(playerid)); dini_IntSet(BurridgeScore, "Respect", GetPlayerRespect(playerid)); } } public BuridgeConnect(playerid) { GetPlayerName(playerid, pname, sizeof(pname)); format(BurridgeScore, sizeof(BurridgeScore), "/Burridge Saver/%s.ini",pname); if(!dini_Exists(BurridgeScore)) { dini_Create(BurridgeScore); dini_IntSet(BurridgeScore, "Score", 0); dini_IntSet(BurridgeScore, "Money", 0); dini_IntSet(BurridgeScore, "Respect", 0); SetPlayerScore(playerid, dini_Int(BurridgeScore, "Score")); SetPlayerMoney(playerid, dini_Int(BurridgeScore, "Money")); SetPlayerRespect(playerid, dini_Int(BurridgeScore, "Respect")); } else { SetPlayerScore(playerid, dini_Int(BurridgeScore, "Score")); SetPlayerMoney(playerid, dini_Int(BurridgeScore, "Money")); SetPlayerRespect(playerid, dini_Int(BurridgeScore, "Respect")); } return 1; } public OnPlayerConnect(playerid) { BuridgeConnect(playerid); return 1; } public OnPlayerDisconnect(playerid) { BuridgeDisconnect(playerid); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/myrespect", cmdtext, true, 10) == 0) { SendClientMessage(playerid, COLOR, "You have " + GetPlayerRespect(playerid) + "respect points.") return 1; } return 0; }
(And explane me what you did)