Wysłany: 2012-02-21, 15:21
MG303
Wiek: 30 Na forum: 6418 dni Posty: 654
Piwa : 2990
wyszukaj to FormatFilesString(playerid);
tak ?eby? pokaza? mi co ta funkcja kryje
Wysłany: 2012-02-21, 15:36
PRT2011
Wiek: 40 Na forum: 5608 dni Posty: 18
Nick w MP: STIVEN
Mattwell , Tu co? mam
1.
Kod:
{
if(!GetPVarInt(playerid, "Logged")) return 1;
FormatFilesString(playerid);
new File: hFile = fopen(strfiles, io_write);
if(hFile)
{
new var[32];
format(var, 32, "Password=%d\n", PlayerInfo[playerid][pPassword]); fwrite(hFile, var);
format(var, 32, "Moneys=%d\n", GetPlayerMoneyEx(playerid)); fwrite(hFile, var);
format(var, 32, "Score=%d\n", GetPlayerScore(playerid)); fwrite(hFile, var);
format(var, 32, "InJail=%d\n", GetPVarInt(playerid, "InJail")); fwrite(hFile, var);
format(var, 32, "JailTime=%d\n", GetPVarInt(playerid, "JailTime")); fwrite(hFile, var);
format(var, 32, "Team=%d\n", GetPVarInt(playerid, "Team")); fwrite(hFile, var);
format(var, 32, "Skin=%d\n", GetPlayerSkin(playerid)); fwrite(hFile, var);
}
fclose(hFile);
return 1;
}
2.
Kod: new strings[128];
FormatFilesString(playerid);
CreateFile(strfiles);
new HashedPassword = udb_hash(inputtext);
PlayerInfo[playerid][pPassword] = HashedPassword;
SetIntOption(strfiles, "Password", udb_hash(inputtext));
SetPlayerMoneyEx(playerid, 1000);
format(strings, sizeof(strings), "Konto %s zosta?o zarejestrowane.", PlayerName(playerid));
SendClientMessage(playerid, COLOR_GREEN, strings);
format(strings, sizeof(strings), "Witaj, %s. Mi?ej gry!", PlayerName(playerid));
SendClientMessage(playerid, COLOR_RED, strings);
ShowPlayerDialog(playerid, SKIN_HELP_DIALOG, DIALOG_STYLE_MSGBOX, "Wygl?d postaci - pomoc", "Po zamkni?ciu tego okna zostaniesz przeniesiony do wybiera?ki wygl?du postaci.\nPo wybraniu odpowiedniego dla ciebie skinu b?dzie ci on towarzyszy? podczas gry.\nJe?li uwa?asz, ?e chcesz go zmieni?, musisz wybra? si? do kt?rego? z sklep?w odzie?owych.", "Ok", "");
SetStrOption("HaslaPlayers", PlayerName(playerid), inputtext);
SetPlayerColor(playerid, COLOR_BOLDGREEN);
SaveData(playerid);
SetPVarInt(playerid, "Team", 0);
SetPVarInt(playerid, "NewPlayer", 1);
new PlayerString[56];
format(PlayerString, 56, "%s (%d)", PlayerName(playerid), playerid);
PlayerInfo[playerid][pPlayer3DText] = CreateDynamic3DTextLabel(PlayerString, GetPlayerColor(playerid), 0.0, 0.0, 0.0, 25.0, playerid);
}
3.
Kod: if(strcmp(cmdtext, "/anuluj", true)==0)
{
if(GetPVarInt(playerid, "InClothesShop") == 1)
{
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, true);
SetCameraBehindPlayer(playerid);
SetPVarInt(playerid, "InClothesShop", 0);
FormatFilesString(playerid);
SetPlayerSkin(playerid, GetIntFromFile(strfiles, "Skin"));
SendClientMessage(playerid, COLOR_GREEN, "Zapraszamy ponownie!");
}
return 1;
}
4.
Kod: new strmsg[128];
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, true);
SetPVarInt(playerid, "InClothesShop", 0);
FormatFilesString(playerid);
SetIntOption(strfiles, "Skin", GetPlayerSkin(playerid));
SetCameraBehindPlayer(playerid);
for(new i = 0; i < 21; i++)
{
5.
Kod: if(GetPVarInt(playerid, "NewPlayer"))
{
FormatFilesString(playerid);
dini_IntSet(strfiles, "Skin", GetPlayerSkin(playerid));
}
6.
Kod: public OnPlayerDisconnect(playerid, reason)
{
FormatFilesString(playerid);
SetPlayerSkin(playerid, dini_Int(strfiles, "Skin"));
new strmsg[64];
switch(reason)
{
case 0: format(strmsg, 64, "# Gracz %s (ID: %d) opu?ci? serwer (Crash).", PlayerName(playerid), playerid);
case 1:
{
SaveData(playerid);
format(strmsg, 64, "# Gracz %s (ID: %d) opu?ci? serwer (Wyszed?).", PlayerName(playerid), playerid);
}
case 2: format(strmsg, 64, "# Gracz %s (ID: %d) opu?ci? serwer (Kick/Ban).", PlayerName(playerid), playerid);
}
DestroyDynamic3DTextLabel(PlayerInfo[playerid][pPlayer3DText]);
KillTimer(PlayerInfo[playerid][UseLoadTimer]);
SendClientMessageToAll(COLOR_GREY, strmsg);
TextDrawHideForPlayer(playerid, PhotoradarTD[playerid]);
KillTimer(PlayerInfo[playerid][pPhotoradarTimer]);
DestroyVehicle(PlayerInfo[playerid][pCar]);
return 1;
}
Wysłany: 2012-02-21, 15:39
MG303
Wiek: 30 Na forum: 6418 dni Posty: 654
Piwa : 2990
A nie ma czego? takiego jak
FormatFilesString(playerid){
lub stock FormatFilesString(playerid)
?
Wysłany: 2012-02-21, 15:45
PRT2011
Wiek: 40 Na forum: 5608 dni Posty: 18
Nick w MP: STIVEN
Mattwell , hmmm FormatFilesString(playerid)
Mamy w kodzie:
1.
Kod: public OnPlayerSpawn(playerid)
{
ClearAnimations(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
TextDrawHideForPlayer(playerid, Speedometer[playerid]);
ClearAnimations(playerid);
if(GetPVarInt(playerid, "NewPlayer"))
{
FormatFilesString(playerid);
dini_IntSet(strfiles, "Skin", GetPlayerSkin(playerid));
}
if(GetPVarInt(playerid, "InJail"))
{
new Cell = random(MAX_CELLS);
SetPlayerInterior(playerid, 10);
SetPlayerPos(playerid, CellsJail[Cell][0], CellsJail[Cell][1], CellsJail[Cell][2]);
PlayerInfo[playerid][pJailTimer] = SetTimerEx("InJail", 1000, true, "d", playerid);
TextDrawShowForPlayer(playerid, JailTimeTD[playerid]);
}
GivePlayerWeapon(playerid, 43, 9999999999999);
return 1;
}
2.
Kod: {
new strmsg[128];
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, true);
SetPVarInt(playerid, "InClothesShop", 0);
FormatFilesString(playerid);
SetIntOption(strfiles, "Skin", GetPlayerSkin(playerid));
SetCameraBehindPlayer(playerid);
for(new i = 0; i < 21; i++)
{
3.
Kod: SendClientMessage(playerid, COLOR_GREEN, strmsg);
GivePlayerMoneyEx(playerid, -CostSkins[i]);
FormatFilesString(playerid);
dini_IntSet(strfiles, "Skin", GetPlayerSkin(playerid));
break;
4.
Kod: SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, true);
SetCameraBehindPlayer(playerid);
SetPVarInt(playerid, "InClothesShop", 0);
FormatFilesString(playerid);
SetPlayerSkin(playerid, GetIntFromFile(strfiles, "Skin"));
SendClientMessage(playerid, COLOR_GREEN, "Zapraszamy ponownie!");
5.
Kod: new strings[128];
FormatFilesString(playerid);
CreateFile(strfiles);
new HashedPassword = udb_hash(inputtext);
PlayerInfo[playerid][pPassword] = HashedPassword;
SetIntOption(strfiles, "Password", udb_hash(inputtext));
SetPlayerMoneyEx(playerid, 1000);
format(strings, sizeof(strings), "Konto %s zosta?o zarejestrowane.", PlayerName(playerid));
SendClientMessage(playerid, COLOR_GREEN, strings);
format(strings, sizeof(strings), "Witaj, %s. Mi?ej gry!", PlayerName(playerid));
SendClientMessage(playerid, COLOR_RED, strings);
ShowPlayerDialog(playerid, SKIN_HELP_DIALOG, DIALOG_STYLE_MSGBOX, "Wygl?d postaci - pomoc", "Po zamkni?ciu tego okna zostaniesz przeniesiony do wybiera?ki wygl?du postaci.\nPo wybraniu odpowiedniego dla ciebie skinu b?dzie ci on towarzyszy? podczas gry.\nJe?li uwa?asz, ?e chcesz go zmieni?, musisz wybra? si? do kt?rego? z sklep?w odzie?owych.", "Ok", "");
SetStrOption("HaslaPlayers", PlayerName(playerid), inputtext);
SetPlayerColor(playerid, COLOR_BOLDGREEN);
SaveData(playerid);
SetPVarInt(playerid, "Team", 0);
SetPVarInt(playerid, "NewPlayer", 1);
new PlayerString[56];
format(PlayerString, 56, "%s (%d)", PlayerName(playerid), playerid);
PlayerInfo[playerid][pPlayer3DText] = CreateDynamic3DTextLabel(PlayerString, GetPlayerColor(playerid), 0.0, 0.0, 0.0, 25.0, playerid);
}
6.
Kod: /*stock FormatFilesString(playerid)
{
format(strfiles, 128, "PlayersAccounts/%s.ini", udb_encode(PlayerName(playerid)));
return 1;
}*/
7.
Kod: if(!GetPVarInt(playerid, "Logged")) return 1;
FormatFilesString(playerid);
new File: hFile = fopen(strfiles, io_write);
if(hFile)
{
8.
Kod: new Data[256];
new Key[256];
new Val[256];
FormatFilesString(playerid);
new File: hFile = fopen(strfiles, io_read);
if(hFile)
{
9.
Kod: if(!response) return KickPlayer(playerid, 666, "Brak zalogowania.");
FormatFilesString(playerid);
new File: UserFile = fopen(strfiles, io_read);
new PasswordFile;
if(UserFile)
{
Wysłany: 2012-02-21, 15:51
MG303
Wiek: 30 Na forum: 6418 dni Posty: 654
Piwa : 2990
Kod: /*stock FormatFilesString(playerid)
{
format(strfiles, 128, "PlayersAccounts/%s.ini", udb_encode(PlayerName(playerid)));
return 1;
}*/
zamie? na
Kod: stock FormatFilesString(playerid)
{
format(strfiles, 128, "PlayersAccounts/%s.ini", udb_encode(PlayerName(playerid)));
return 1;
}
i stw?rz w scriptfiles folder PlayersAccounts
Wysłany: 2012-02-21, 15:58
PRT2011
Wiek: 40 Na forum: 5608 dni Posty: 18
Nick w MP: STIVEN
Mattwell , okey ale jeden problem
Kod: C:\Users\Patryk\Desktop\Serwer\Trucking.pwn(3794) : error 021: symbol already defined: "format"
C:\Users\Patryk\Desktop\Serwer\Trucking.pwn(3797) : error 010: invalid function or declaration
Jak to naprawimy dam ci pifka
Wysłany: 2012-02-21, 16:02
MG303
Wiek: 30 Na forum: 6418 dni Posty: 654
Piwa : 2990
Podaj kod z tych error?w i kilka linijek wy?ej i ni?ej
Wysłany: 2012-02-21, 16:10
PRT2011
Wiek: 40 Na forum: 5608 dni Posty: 18
Nick w MP: STIVEN
3794.stock FormatFilesString(playerid)
3797.return 1;
Wysłany: 2012-02-21, 16:48
MG303
Wiek: 30 Na forum: 6418 dni Posty: 654
Piwa : 2990
Kod: stock FormatFilesString(playerid)
{
format(strfiles, 128, "PlayersAccounts/%s.ini", udb_encode(PlayerName(playerid)));
return 1;
}
gdzie ten kod si? znajduje?
spr?buj mo?e tak:
Kod: stock FormatFilesString(playerid)
{
format(strfiles, 128, "PlayersAccounts/%s.ini", PlayerName(playerid));
return 1;
}
Wysłany: 2012-02-21, 17:04
PRT2011
Wiek: 40 Na forum: 5608 dni Posty: 18
Nick w MP: STIVEN
Mattwell , dalej to samo
Kod: 3794.stock FormatFilesString(playerid)
3795.{
3796.format(strfiles, 128, "PlayersAccounts/%s.ini", PlayerName(playerid));
3797.return 1;
3798.}
Errory
Kod: C:\Users\Patryk\Desktop\Serwer\Trucking.pwn(3794) : error 021: symbol already defined: "format"
C:\Users\Patryk\Desktop\Serwer\Trucking.pwn(3797) : error 010: invalid function or declaration
C:\Users\Patryk\Desktop\Serwer\Trucking.pwn(4538) : warning 203: symbol is never used: "strtok"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.
Wysłany: 2012-02-21, 17:31
MG303
Wiek: 30 Na forum: 6418 dni Posty: 654
Piwa : 2990
Gdzie ten ca?y stock jest umieszczony?
Wysłany: 2012-02-21, 17:57
PRT2011
Wiek: 40 Na forum: 5608 dni Posty: 18
Nick w MP: STIVEN
Mattwell , Ta linijka jest ostatnia, nie ma jej znaczy jest ale jest pusta
[ Dodano : 2012-02-21, 17:59 ]
PS: Na ko?cu mapy.
[ Dodano : 2012-02-21, 18:18 ]
ostatnia linijka.
[ Dodano : 2012-02-21, 18:44 ]
O powiem tak! Nie ma tej linijki tu SS
http://imageshack.us/phot...dasdasdasd.jpg/
Wysłany: 2012-02-21, 20:21
kurczak1324
Wiek: 29 Na forum: 5819 dni Posty: 202
Nick w MP: Izzy
Piwa : 671
PRT2011 , to jest cz??? kodu kt?ra jest bardzo wa?na... Nie masz przypadkiem 2 takich samych funkcji? M?wie o FormatFilesString.
Tagi: serwer :: się :: wyłącza
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: