Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2014-10-13, 21:47


HIZMEN







Wiek: 27
Na forum: 4633 dni
Posty: 66

Piwa: 48

Respekt: 50

Witam, mam taki problem znalaz?em skrypt na viatoll poprzerabia?em go itp na swoje sposoby .. Ale kurcz? nwm jak zapisa? :( nie mog? . Prosz? o pomoc o to kod. Dodaje mi punkty ale jak wychodze i wchodz? to ju? nie mam pkt viatoll

Kod:

if(dialogid == DIALOG_VIATOLLWYBIERZ)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid,DIALOG_VIATOLLDOLADUJ,2,"Do?aduj punkty ViaToll","10 punkt?w\n20 punkt?w\n50 punkt?w\n100 punkt?w\n200 punkt?w","Wybierz","Zamknij");
}
if(listitem == 1)
{
new string[256];
format(string,sizeof(string),"Masz: %d punkt?w ViaToll",GetPVarInt(playerid,"ViaTollPunkty"),GraczInfo[playerid][Viatoll]);
ShowPlayerDialog(playerid,DIALOG_VIATOLLILOSC,0,"ViaToll",string,"Ok","");
}
}
return 1;
}
if(dialogid == DIALOG_VIATOLLDOLADUJ)
{
if(response)
{
switch(listitem)
{
case 0:
{
SetPVarInt(playerid,"ViaTollPunkty",GetPVarInt(playerid,"ViaTollPunkty") +10);
GivePlayerMoney(playerid,-20);
SendClientMessage(playerid,-1,"Kupi?e? 10 punkt?w ViaToll");
new playerfile[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, sizeof(playerfile), "viatoll/Z_______%s.ini",pname);
dini_IntSet(playerfile,"ViaToll", GetPVarInt(playerid,"ViaTollPunkty"));
}
case 1:
{
SetPVarInt(playerid,"ViaTollPunkty",GetPVarInt(playerid,"ViaTollPunkty") +20);
GivePlayerMoney(playerid,-40);
SendClientMessage(playerid,-1,"Kupi?e? 20 punkt?w ViaToll");
new playerfile[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, sizeof(playerfile), "viatoll/Z_______%s.ini",pname);
dini_IntSet(playerfile,"ViaToll", GetPVarInt(playerid,"ViaTollPunkty"));
}
case 2:
{
SetPVarInt(playerid,"ViaTollPunkty",GetPVarInt(playerid,"ViaTollPunkty") +50);
GivePlayerMoney(playerid,-100);
SendClientMessage(playerid,-1,"Kupi?e? 50 punkt?w ViaToll");
new playerfile[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, sizeof(playerfile), "viatoll/Z_______%s.ini",pname);
dini_IntSet(playerfile,"ViaToll", GetPVarInt(playerid,"ViaTollPunkty"));
}
case 3:
{
SetPVarInt(playerid,"ViaTollPunkty",GetPVarInt(playerid,"ViaTollPunkty") +100);
GivePlayerMoney(playerid,-200);
SendClientMessage(playerid,-1,"Kupi?e? 100 punkt?w ViaToll");
new playerfile[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, sizeof(playerfile), "viatoll/Z_______%s.ini",pname);
dini_IntSet(playerfile,"ViaToll", GetPVarInt(playerid,"ViaTollPunkty"));
}
case 4:
{
SetPVarInt(playerid,"ViaTollPunkty",GetPVarInt(playerid,"ViaTollPunkty") +200);
GivePlayerMoney(playerid,-400);
SendClientMessage(playerid,-1,"Kupi?e? 200 punkt?w ViaToll");
new playerfile[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, sizeof(playerfile),"viatoll/Z_______%s.ini",pname);
dini_IntSet(playerfile,"ViaToll", GetPVarInt(playerid,"ViaTollPunkty"));
}
}
}
return 1;
}




Kod:

new playerfile[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, 256, "viatoll/%s.ini", pname);
new ViaToll = dini_IntSet(playerfile, "ViaToll", 1);
SetPVarInt(playerid,"ViaTollPunkty", ViaToll);
SetPVarInt(playerid,"Odjete", 0);


I my?l? ze tyle wystarczy a teraz podam to co ja zrobi?em ale nie dzia?a

Kod:

stock Wczytaj(playerid)
{
format(plik, 128, "System/%s.ini", PlayerName(playerid));
SetPlayerMoney(playerid,dini_Int(plik,"Kasa"));
SetPlayerScore(playerid,dini_Int(plik,"Punkty"));
GraczInfo[playerid][Bank] = dini_Int(plik, "Bank");
GraczInfo[playerid][Viatoll]= dini_Int(plik, "ViaTollPunkty");
}
stock Stworz(playerid)
{
format(plik, 128, "System/%s.ini", PlayerName(playerid));
dini_Create(plik);
}

stock Zapisz(playerid)
{
format(plik, 128, "System/%s.ini", PlayerName(playerid));
dini_IntSet(plik,"Kasa", GetPlayerMoney(playerid));
dini_IntSet(plik,"Punkty", GetPlayerScore(playerid));
dini_IntSet(plik,"Bank", GraczInfo[playerid][Bank]);
dini_IntSet(plik,"ViaTollPunkty", GraczInfo[playerid][Viatoll]);
}
stock Rejestruj (playerid,key[])
{
new Gracz [64];
new Gname [MAX_PLAYER_NAME];
GetPlayerName(playerid,Gname,sizeof(Gname));
format(Gracz,sizeof(Gracz),"/System/%s.txt",Gname);
dini_Create(Gracz);
dini_Set(Gracz,"Haslo",key);
dini_IntSet(Gracz,"Kasa",1000);
dini_IntSet(Gracz,"Punkty",0);
dini_IntSet(Gracz,"Bank",0);
dini_IntSet(Gracz,"ViaTollPunkty",0);
return 1;
}


i Jeszcze to mam

Kod:

if(GetPVarInt(playerid,"Odjete") == 0)
{
SetTimerEx("Sprawdzilo",2000,0,"d",playerid);
SetPVarInt(playerid,"Odjete",1);

if(GetPVarInt(playerid,"ViaTollPunkty")<=10)
{
SetPVarInt(playerid,"ViaTollPunkty", GetPVarInt(playerid,"ViaTollPunkty") -4);
GameTextForPlayer(playerid, "~y~v", 3000, 4);
}
if(GetPVarInt(playerid,"ViaTollPunkty") == 10)
{
GameTextForPlayer(playerid, "~r~X", 3000, 4);
SetPVarInt(playerid,"ViaTollPunkty", GetPVarInt(playerid,"ViaTollPunkty") -4);
}

}
}


Ostatnio zmieniony przez HIZMEN 2014-10-13, 22:23, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-13, 22:14


akon823

Czekotubka :D






Wiek: 29
Na forum: 4815 dni
Posty: 399
Nick w MP: Remik14

Piwa: 152

Respekt: 76,8

No a jak ma dzia?a? skoro w kodzie masz PVary a zapisujesz jakiego? enuma do pliku ...
To si? zdecyduj albo zmieniasz na enuma i zapisujesz enuma albo po prostu zapisujesz PVara
Kod:

GetPVarInt(playerid,"ViaTollPunkty"

zamiast
Kod:

GraczInfo[playerid][Viatoll]

w tym
Kod:

dini_IntSet(plik,"ViaTollPunkty", GraczInfo[playerid][Viatoll]);


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-14, 08:28


HIZMEN







Wiek: 27
Na forum: 4633 dni
Posty: 66

Piwa: 48

Respekt: 50

Zrobi?em tak jak wcze?niej na pocz?tku by?o i dalej kurde nie zapisuje w pVara Jak by da?o rade czy by? mi to zrobi? w enum?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-14, 10:07


ToxiC.







Wiek: 28
Na forum: 5246 dni
Posty: 3792

Piwa: 8590

Respekt: 1143,8
Respekt: 1143,8

Pawn


stock Wczytaj(playerid) 
{ 
format(plik128"System/%s.ini"PlayerName(playerid)); 
SetPlayerMoney(playerid,dini_Int(plik,"Kasa")); 
SetPlayerScore(playerid,dini_Int(plik,"Punkty")); 
GraczInfo[playerid][Bank] = dini_Int(plik"Bank"); 
SetPVarInt(playerid,"ViaTollPunkty") = dini_Int(plik"ViaTollPunkty"); 
} 
stock Stworz(playerid) 
{ 
format(plik128"System/%s.ini"PlayerName(playerid)); 
dini_Create(plik); 
} 

stock Zapisz(playerid) 
{ 
format(plik128"System/%s.ini"PlayerName(playerid)); 
dini_IntSet(plik,"Kasa"GetPlayerMoney(playerid)); 
dini_IntSet(plik,"Punkty"GetPlayerScore(playerid)); 
dini_IntSet(plik,"Bank"GraczInfo[playerid][Bank]); 
dini_IntSet(plik,"ViaTollPunkty"GetPVarInt(playerid,"ViaTollPunkty")); 
} 


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-14, 10:17


xqz

otaku desu!






Wiek: 32
Na forum: 6406 dni
Posty: 723
Nick w MP: xqz

Piwa: 5465

Respekt: 418,6
Respekt: 418,6

"ToxiC`" napisał/a:

SetPVarInt(playerid,"ViaTollPunkty") = dini_Int(plik, "ViaTollPunkty");


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-14, 11:09


HIZMEN







Wiek: 27
Na forum: 4633 dni
Posty: 66

Piwa: 48

Respekt: 50

Kod:

Hizmen.pwn(5499) : warning 202: number of arguments does not match definition
Hizmen.pwn(5499) : error 022: must be lvalue (non-constant)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
================ READY ================


Takie errory mam

To ta linika
SetPVarInt(playerid,"ViaTollPunkty") = dini_Int(plik, "ViaTollPunkty");

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-14, 11:17


IgrexolonO







Wiek: 34
Na forum: 6809 dni
Posty: 1386

Piwa: 1062

Respekt: 651,8
Respekt: 651,8Respekt: 651,8

Kod:

SetPVarInt(playerid,"ViaTollPunkty", dini_Int(plik, "ViaTollPunkty");


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-14, 16:18


xqz

otaku desu!






Wiek: 32
Na forum: 6406 dni
Posty: 723
Nick w MP: xqz

Piwa: 5465

Respekt: 418,6
Respekt: 418,6

"IgrexolonO" napisał/a:

Kod:

SetPVarInt(playerid,"ViaTollPunkty", dini_Int(plik, "ViaTollPunkty");

Jednego cytuje by znalaz? sw?j b??d.
Ty za? zgubi?e? nawias ;D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-14, 18:43


HIZMEN







Wiek: 27
Na forum: 4633 dni
Posty: 66

Piwa: 48

Respekt: 50

Dzi?ki dzia?a :) teraz sprawdz? czy zapisuje :)

EDIT

Dzia?a :) dzi?ki po :piwo:

Postaw piwo autorowi tego posta
 

 
Tagi: zapis :: dini
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku