Szerző Téma: Pénz lekérés  (Megtekintve 1120 alkalommal)

Pénz lekérés
« Dátum: 2014. október 02. - 18:34:16 »
0 Show voters
Valaki megtudná mondani,miért nem tölti be a pénzt ebben a reg rendszerben:
 
#include <a_samp>
#include <Dini>
#include \"../include/gl_common.inc\"
new szoveg1[128];
new Fajl[256];
new total_vehicles_from_files=0;
enum pAdat
{
        pPenz,
        pSkin,
        pReg,
        Float:X,
        Float:Y,
        Float:Z,
        Float:Angle
}
new JatekosInfo[MAX_PLAYERS][pAdat];
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_NEM 3
#define KEK 0x00ccffAA
#define ZOLD 0x43e85fAA
#define FEHER 0xffffffAA
main()
{
print(\"\\n----------------------------------\");
print(\" Blank Gamemode by your name here\");
print(\"----------------------------------\\n\");
}
#pragma tabsize 0
public OnGameModeInit()
{
SetGameModeText(\"Valos\");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
// SPECIAL
total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/trains.txt\");
total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/pilots.txt\");
      // LAS VENTURAS
     total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/lv_law.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/lv_airport.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/lv_gen.txt\");
    // SAN FIERRO
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/sf_law.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/sf_airport.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/sf_gen.txt\");
    // LOS SANTOS
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/ls_law.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/ls_airport.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/ls_gen_inner.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/ls_gen_outer.txt\");
    // OTHER AREAS
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/whetstone.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/bone.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/flint.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/tierra.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/red_county.txt\");
    printf(\"Total vehicles from files: %d\",total_vehicles_from_files);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
        SetSpawnInfo(playerid,0,26,2269.4287,-75.1134,26.7724,178.8719,0,0,0,0,0,0);
        SpawnPlayer(playerid);
    format(Fajl,sizeof(Fajl),\"/Karakterek/%s.ini\",Neve(playerid));
    format(szoveg1,sizeof(szoveg1),\"Üdvözöllek %s!\",Neve(playerid));
    if(fexist(Fajl))
    {
        ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,szoveg1,\"Ez a név már regisztrálva van!\\nKérlek jelentkezz be!\",\"Belép\",\"Kilép\");
    }
    else
    {
        ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,szoveg1,\"Ez a név még nincsen regisztrálva!\\nKérlek regisztrálj!\",\"Regisztrál\",\"Kilép\");
    }
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
        new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    JatekosInfo[playerid][X] = x;
    JatekosInfo[playerid][Y] = y;
    JatekosInfo[playerid][Z] = z;
    JatekosInfo[playerid][pPenz] = GetPlayerMoney(playerid);
    JatekosInfo[playerid][pSkin] = GetPlayerSkin(playerid);
    GetPlayerFacingAngle(playerid,JatekosInfo[playerid][Angle]);
        format(Fajl,sizeof(Fajl),\"/Karakterek/%s.ini\",Neve(playerid));
        dini_IntSet(Fajl,\"Penz\",JatekosInfo[playerid][pPenz]);
        dini_IntSet(Fajl,\"Skin\",JatekosInfo[playerid][pSkin]);
        dini_FloatSet(Fajl,\"Latoszog\",JatekosInfo[playerid][Angle]);
        dini_FloatSet(Fajl,\"X\",Float:JatekosInfo[playerid][X]);
        dini_FloatSet(Fajl,\"Y\",Float:JatekosInfo[playerid][Y]);
        dini_FloatSet(Fajl,\"Z\",Float:JatekosInfo[playerid][Z]);
        return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/mycommand\", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
        format(Fajl,sizeof(Fajl),\"/Karakterek/%s.ini\",Neve(playerid));
        if(dialogid == DIALOG_REGISTER)
        {
            if(response)
            {
                        dini_Create(Fajl);
                        dini_Set(Fajl,\"Jelszo\",inputtext);
                        dini_IntSet(Fajl,\"Penz\",30);
                        dini_IntSet(Fajl,\"Skin\",0);
                        SpawnPlayer(playerid);
                        ShowPlayerDialog(playerid,DIALOG_NEM,DIALOG_STYLE_LIST,\"Regisztráció...\",\"Fiú\\nLány\",\"Folytat\",\"Kilép\");
            }
            else
            {
                dini_Remove(Fajl);
                Kick(playerid);
            }
        }
        if(dialogid == DIALOG_NEM)
        {
            if(response)
            {
                        if(listitem == 0)
                        {
                                dini_IntSet(Fajl,\"Nem\",1);
                                SendClientMessage(playerid,KEK,\"Fiú lettél!\");
                                SetPlayerSkin(playerid,60);
                        }
                        if(listitem == 1)
                        {
                                dini_IntSet(Fajl,\"Nem\",2);
                                SendClientMessage(playerid,KEK,\"Lány lettél!\");
                                SetPlayerSkin(playerid,233);
                        }
            }
            else
            {
                dini_Remove(Fajl);
                Kick(playerid);
            }
        }
        if(dialogid == DIALOG_LOGIN)
        {
            if(response)
            {
                        new jelszo[200];
                        format(jelszo, sizeof(jelszo), \"%s\", dini_Get(Fajl, \"Jelszo\"));
                        if(strcmp(inputtext, jelszo) == 0)
                        {
                                JatekosInfo[playerid][pPenz] = dini_Int(Fajl, \"Penz\");
                                JatekosInfo[playerid][pSkin] = dini_Int(Fajl,\"Skin\");
                                JatekosInfo[playerid][Angle] = dini_Int(Fajl, \"posicio\");
                                JatekosInfo[playerid][Angle] = dini_Int(Fajl, \"Latoszog\");
                                JatekosInfo[playerid][X] = dini_Int(Fajl, \"X\");
                                JatekosInfo[playerid][Y] = dini_Int(Fajl, \"Y\");
                                JatekosInfo[playerid][Z] = dini_Int(Fajl, \"Z\");
                                SetPlayerSkin(playerid,JatekosInfo[playerid][pSkin]);
                                SetPlayerColor(playerid,FEHER);
                                SetSpawnInfo(playerid,0,JatekosInfo[playerid][pSkin],JatekosInfo[playerid][X],JatekosInfo[playerid][Y],JatekosInfo[playerid][Z],JatekosInfo[playerid][Angle],0,0,0,0,0,0);
                                SpawnPlayer(playerid);
                                GivePlayerMoney(playerid,JatekosInfo[playerid][pPenz]);
                                SendClientMessage(playerid,KEK,\"Sikeresen Bejelentkeztél!\");
                        }
                        else
                        {
                                ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,\"Bejelentkezõ Panel\",\"Rossz jelszó!\\nJelentkezz be!\",\"Oké\",\"Kilép\");
                        }
            }
            else
            {
                Kick(playerid);
            }
        }
        return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
stock Neve(playerid)
{
        new Nev[MAX_PLAYER_NAME];
        GetPlayerName(playerid,Nev,sizeof(Nev));
        return Nev;
}

,tehát menteni menti,csak belépéskor nem tölti vissza?
« Utoljára szerkesztve: 2014. október 03. - 12:26:02 írta Flash »

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Pénz lekérés
« Válasz #1 Dátum: 2014. október 03. - 12:29:10 »
0 Show voters
Nem nagyon foglalkozok dinivel, de szerintem az a hibája hogy spawnolás elött adod a játékosnak a pénzt bejelentkezés után.
Helyesen így csináld:
Töröld a \'Sikeresen bejelentkeztél\' felöl ezt:
 
GivePlayerMoney(playerid,JatekosInfo[playerid][pPenz]);

 
és helyére rakd be ezt:
 
      SetPVarInt(playerid, \"NowLoogedIn\", 1);

 
És az OnPlayerSpawn alá rakd ezt:
 
   if(GetPVarInt(playerid, \"NowLoogedIn\")) {
SetPVarInt(playerid, \"NowLoogedIn\", 0);
GivePlayerMoney(playerid,JatekosInfo[playerid][pPenz]);
}

Pénz lekérés
« Válasz #2 Dátum: 2014. október 09. - 18:24:20 »
0 Show voters
de érdekes az,hogy ha ezt a sort nem irmo de: JatekosInfo[playerid][pPenz] = GetPlayerMoney(playerid);,akkor nem is menti le a pénzt,simplan dini_IntSet-el nem menti le pedig elméletileg le kellene mentse,és simplan dini_Int-el meg nem tölti ve,de GivePlayerMoney-al sem t9lti be :( ?,ienkor mit kell tenni,vagy hogyan kell csinálni?

Pénz lekérés
« Válasz #3 Dátum: 2014. október 09. - 21:34:07 »
0 Show voters
pedig le kéne mentenie.. minden más jó, csak a pénz nem?

Pénz lekérés
« Válasz #4 Dátum: 2014. október 10. - 05:57:01 »
0 Show voters
És a skint sem menti le

Pénz lekérés
« Válasz #5 Dátum: 2014. október 10. - 09:21:05 »
0 Show voters
nálad a hiba. nekem jól elmenti fájlba, és be is tölti a skint, a pénzt, de még a pozíciómat is.

Pénz lekérés
« Válasz #6 Dátum: 2014. október 10. - 17:14:14 »
0 Show voters
De akkor mivel lehet gond?Látod a poziciot meg a látoszoget jol menti,meg be is tölti nekem is!!
NAGY elnézésk kivnok,most veszem észre hogy ez nem az a pawno kod amiben nekem nem menti,vagyis erröl volna szó:
#include <a_samp>
#include <dini>
#include <dudb>
#define regisztracio 0
#define bejelentkezes 1
#define HIBA 0xFF0000FF
new nev[MAX_PLAYER_NAME];
enum JatekosAdatok
{
Skin,
Penz,
Float:X,
Float:Y,
Float:Z,
}
new JatekosInfo[MAX_PLAYERS][JatekosAdatok];
 
main()
{
print(\"\\n----------------------------------\");
print(\" Blank Gamemode by your name here\");
print(\"----------------------------------\\n\");
}
 
public OnGameModeInit()
{
// Don\'t use these lines if it\'s a filterscript
SetGameModeText(\"Blank Script\");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
new file[256];
GetPlayerName(playerid,nev,sizeof(nev));
format(file,sizeof(file),\"/Karakterek/%s.ini\",nev);
new string[256];
if(!fexist(file))
{
format(string, sizeof string, \"Üdv %s! \\nKérjük regisztrálj! \\n\\nAdd meg a kívánt jelszavadat!\", nev);
ShowPlayerDialog(playerid, regisztracio, DIALOG_STYLE_INPUT, \"Regisztráció\", string, \"Regisztráció\", \"Kilépés\");
}
if(fexist(file))
{
format(string, sizeof string, \"Üdv %s! \\nKérjük jelentkezz be! \\n\\nÍrd be a jelszavadat!\", nev);
ShowPlayerDialog(playerid, bejelentkezes, DIALOG_STYLE_INPUT, \"Bejelentkezés\", string, \"Bejelentkezés\", \"Kilépés\");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new file[128];
new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    JatekosInfo[playerid][X] = x;
    JatekosInfo[playerid][Y] = y;
    JatekosInfo[playerid][Z] = z;
GetPlayerName(playerid,nev,sizeof(nev));
format(file,sizeof(file),\"/Karakterek/%s.ini\",nev);
if(fexist(file))
{
    dini_IntSet(file,\"Skin\",JatekosInfo[playerid][skin]);
    dini_IntSet(file,\"Penz\",GetPlayerMoney(playerid));
dini_FloatSet(file,\"X\",JatekosInfo[playerid][X]);
        dini_FloatSet(file,\"Y\",JatekosInfo[playerid][Y]);
        dini_FloatSet(file,\"Z\",JatekosInfo[playerid][Z]);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/mycommand\", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == regisztracio)
{
 if(response)
 {
    new file[128];
    new string[128];
    GetPlayerName(playerid, nev, sizeof(nev));
    if(strlen(inputtext) == 0)
{
      format(string, sizeof string, \"Üdv %s! \\nKérjük regisztrálj! \\n\\nAdd meg a kívánt jelszavadat!\", nev);
      ShowPlayerDialog(playerid, regisztracio, DIALOG_STYLE_INPUT, \"Regisztráció\", string, \"Regisztráció\", \"Kilépés\");
      return 0;
}
format(file,sizeof(file),\"/Karakterek/%s.ini\",nev);
if(!fexist(file))
   {
      dini_Create(file);
      dini_IntSet(file, \"Antibug\",0);
      dini_IntSet(file, \"Jelszo\",udb_hash(inputtext));
      dini_IntSet(file,\"Skin\", 0);
      dini_IntSet(file,\"Penz\", 30);
   }
}
}
if(dialogid == bejelentkezes)
{
if(response)
{
    new file[128];
    new string[128];
            GetPlayerName(playerid, nev, sizeof(nev));
   if(strlen(inputtext) == 0)
   {
       format(string, sizeof string, \"Bejelentkezés \\n\\nÜdv %s! \\nRegisztrálva vagy! \\n\\nÍrd be a jelszavadat!\", nev);
      ShowPlayerDialog(playerid, bejelentkezes, DIALOG_STYLE_INPUT, \"Bejelentkezés\", string, \"Belépés\", \"Kilépés\");
      return 0;
   }
   format(file,sizeof(file),\"/Karakterek/%s.ini\",nev);
   if(fexist(file))
   {
             new jelszo = dini_Int(file, \"Jelszo\");
          if(udb_hash(inputtext) == jelszo)
      {
         JatekosInfo[playerid][skin] = dini_Int(file,\"Skin\");
         JatekosInfo[playerid][Penz] = dini_Int(file,\"Penz\");
         JatekosInfo[playerid][X] = dini_Float(file, \"X\");
         JatekosInfo[playerid][Y] = dini_Float(file, \"Y\");
         JatekosInfo[playerid][Z] = dini_Float(file, \"Z\");
      }
               else
      {
          SendClientMessage(playerid, HIBA, \"Rossz jelszó!\");
           printf(\"%s bejelentkezése sikertelen volt.\", nev);
           Kick(playerid);
      }
   }
}
else
{
    Kick(playerid);
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}

Ebben nem menti a pénzt meg a skint,és nem tudom mi a külömbség a másiktol hogy ez nem menti :(,mégegyszer elnézést a félrevezetésért!!
És van ez a script,ebben mindent ment és be is tölt,csak azért kellene az elözö mert az tökéletes regi rendszer,ez meg tele van aprobb hibákkal,de nem tudom mi olyan nagyon más az alsobann ,a felsöhöz képest?
Ez amiben ment és be is tölt:
#include <a_samp>
#include <Dini>
#include \"../include/gl_common.inc\"
new szoveg1[128];
new Fajl[256];
new total_vehicles_from_files=0;
enum pAdat
{
        pPenz,
        pSkin,
        pReg,
        Float:X,
        Float:Y,
        Float:Z,
        Float:Angle
}
new JatekosInfo[MAX_PLAYERS][pAdat];
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_NEM 3
#define KEK 0x00ccffAA
#define ZOLD 0x43e85fAA
#define FEHER 0xffffffAA
main()
{
print(\"\\n----------------------------------\");
print(\" Blank Gamemode by your name here\");
print(\"----------------------------------\\n\");
}
#pragma tabsize 0
public OnGameModeInit()
{
SetGameModeText(\"Valos\");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
// SPECIAL
total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/trains.txt\");
total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/pilots.txt\");
      // LAS VENTURAS
     total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/lv_law.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/lv_airport.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/lv_gen.txt\");
    // SAN FIERRO
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/sf_law.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/sf_airport.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/sf_gen.txt\");
    // LOS SANTOS
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/ls_law.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/ls_airport.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/ls_gen_inner.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/ls_gen_outer.txt\");
    // OTHER AREAS
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/whetstone.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/bone.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/flint.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/tierra.txt\");
    total_vehicles_from_files += LoadStaticVehiclesFromFile(\"vehicles/red_county.txt\");
    printf(\"Total vehicles from files: %d\",total_vehicles_from_files);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
        SetSpawnInfo(playerid,0,26,2269.4287,-75.1134,26.7724,178.8719,0,0,0,0,0,0);
        SpawnPlayer(playerid);
    format(Fajl,sizeof(Fajl),\"/Karakterek/%s.ini\",Neve(playerid));
    format(szoveg1,sizeof(szoveg1),\"Üdvözöllek %s!\",Neve(playerid));
    if(fexist(Fajl))
    {
        ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,szoveg1,\"Ez a név már regisztrálva van!\\nKérlek jelentkezz be!\",\"Belép\",\"Kilép\");
    }
    else
    {
        ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,szoveg1,\"Ez a név még nincsen regisztrálva!\\nKérlek regisztrálj!\",\"Regisztrál\",\"Kilép\");
    }
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
        new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    JatekosInfo[playerid][X] = x;
    JatekosInfo[playerid][Y] = y;
    JatekosInfo[playerid][Z] = z;
    JatekosInfo[playerid][pPenz] = GetPlayerMoney(playerid);
    JatekosInfo[playerid][pSkin] = GetPlayerSkin(playerid);
    GetPlayerFacingAngle(playerid,JatekosInfo[playerid][Angle]);
        format(Fajl,sizeof(Fajl),\"/Karakterek/%s.ini\",Neve(playerid));
        dini_IntSet(Fajl,\"Penz\",JatekosInfo[playerid][pPenz]);
        dini_IntSet(Fajl,\"Skin\",JatekosInfo[playerid][pSkin]);
        dini_FloatSet(Fajl,\"Latoszog\",JatekosInfo[playerid][Angle]);
        dini_FloatSet(Fajl,\"X\",Float:JatekosInfo[playerid][X]);
        dini_FloatSet(Fajl,\"Y\",Float:JatekosInfo[playerid][Y]);
        dini_FloatSet(Fajl,\"Z\",Float:JatekosInfo[playerid][Z]);
        return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/mycommand\", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
        format(Fajl,sizeof(Fajl),\"/Karakterek/%s.ini\",Neve(playerid));
        if(dialogid == DIALOG_REGISTER)
        {
            if(response)
            {
                        dini_Create(Fajl);
                        dini_Set(Fajl,\"Jelszo\",inputtext);
                        dini_IntSet(Fajl,\"Penz\",30);
                        dini_IntSet(Fajl,\"Skin\",0);
                        SpawnPlayer(playerid);
                        ShowPlayerDialog(playerid,DIALOG_NEM,DIALOG_STYLE_LIST,\"Regisztráció...\",\"Fiú\\nLány\",\"Folytat\",\"Kilép\");
            }
            else
            {
                dini_Remove(Fajl);
                Kick(playerid);
            }
        }
        if(dialogid == DIALOG_NEM)
        {
            if(response)
            {
                        if(listitem == 0)
                        {
                                dini_IntSet(Fajl,\"Nem\",1);
                                SendClientMessage(playerid,KEK,\"Fiú lettél!\");
                                SetPlayerSkin(playerid,60);
                        }
                        if(listitem == 1)
                        {
                                dini_IntSet(Fajl,\"Nem\",2);
                                SendClientMessage(playerid,KEK,\"Lány lettél!\");
                                SetPlayerSkin(playerid,233);
                        }
            }
            else
            {
                dini_Remove(Fajl);
                Kick(playerid);
            }
        }
        if(dialogid == DIALOG_LOGIN)
        {
            if(response)
            {
                        new jelszo[200];
                        format(jelszo, sizeof(jelszo), \"%s\", dini_Get(Fajl, \"Jelszo\"));
                        if(strcmp(inputtext, jelszo) == 0)
                        {
                                JatekosInfo[playerid][pPenz] = dini_Int(Fajl, \"Penz\");
                                JatekosInfo[playerid][pSkin] = dini_Int(Fajl,\"Skin\");
                                JatekosInfo[playerid][Angle] = dini_Int(Fajl, \"posicio\");
                                JatekosInfo[playerid][Angle] = dini_Int(Fajl, \"Latoszog\");
                                JatekosInfo[playerid][X] = dini_Int(Fajl, \"X\");
                                JatekosInfo[playerid][Y] = dini_Int(Fajl, \"Y\");
                                JatekosInfo[playerid][Z] = dini_Int(Fajl, \"Z\");
                                SetPlayerSkin(playerid,JatekosInfo[playerid][pSkin]);
                                SetPlayerColor(playerid,FEHER);
                                SetSpawnInfo(playerid,0,JatekosInfo[playerid][pSkin],JatekosInfo[playerid][X],JatekosInfo[playerid][Y],JatekosInfo[playerid][Z],JatekosInfo[playerid][Angle],0,0,0,0,0,0);
                                SpawnPlayer(playerid);
                                GivePlayerMoney(playerid,JatekosInfo[playerid][pPenz]);
                                SendClientMessage(playerid,KEK,\"Sikeresen Bejelentkeztél!\");
                        }
                        else
                        {
                                ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,\"Bejelentkezõ Panel\",\"Rossz jelszó!\\nJelentkezz be!\",\"Oké\",\"Kilép\");
                        }
            }
            else
            {
                Kick(playerid);
            }
        }
        return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
stock Neve(playerid)
{
        new Nev[MAX_PLAYER_NAME];
        GetPlayerName(playerid,Nev,sizeof(Nev));
        return Nev;
}

 
A pénzel ugy csinál,hogy hozzaadja mikor belépik ,és nyomba ugy fogy is le a pénz 0 ra
« Utoljára szerkesztve: 2014. október 10. - 18:43:26 írta lorantf »

Pénz lekérés
« Válasz #7 Dátum: 2014. október 10. - 20:08:40 »
0 Show voters
Beolvasásnál:
 
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid,       dini_Int(file, \"Penz\"));

Pénz lekérés
« Válasz #8 Dátum: 2014. október 10. - 20:12:14 »
0 Show voters
Nem müködik,lefele számlálja,hozzáadja,majd mikor lespawol akkor leviszi 0ig és anyi :(
Sikerült megoldjam a problémát!Zárok!
« Utoljára szerkesztve: 2014. október 12. - 14:44:45 írta lorantf »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal