GTAvision.com - Forum - Grand Theft Auto News, Downloads, Community and more...

Position: Grand Theft Auto: San Andreas » Multiplayer » Scripte und kleine Codes » REgister/login system » Druckansicht
marcel9, 29.07.2008, 14:00
ich habe mal geguckt nach einem register und login system wo mit ich geld speichern kann ich hab
mir bei beispiel skript mal donlaodet aber so viele fehler obwohl ich die drei dini teile hab ...
kan mir jemand einen skript als antwort schreiben der schon fertig ist?
FloRaX, 29.07.2008, 14:27
Musst bisschen auf die Rechtschreibung achten.
Und:

hast du public PlayerName(playerid) ?
Oder stock PlayerName(playerid) ?
marcel9, 29.07.2008, 15:32
ich hab das : stock PlayerName(playerid) {
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}


mehr net
FloRaX, 29.07.2008, 18:57
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#include <a_samp>

#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_YELLOW 0xFFFF00AA

new bank[MAX_PLAYERS];

strtok(const string[], &index)
{
   new length = strlen(string);
   while ((index < length) && (string[index] <= ' '))
   {
      index++;
   }

   new offset = index;
   new result[20];
   while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
   {
      result[index - offset] = string[index];
      index++;
   }
   result[index - offset] = EOS;
   return result;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
   new cmd[256];
   new idx;
   new bank[MAX_PLAYERS];

   cmd = strtok(cmdtext, idx);

   if(strcmp(cmd, "/speichern", true) == 0 )
      {
         new tmp[256];
         new moneys;
         new string[256];
          tmp = strtok(cmdtext, idx);

          if(!strlen(tmp))
            {
               SendClientMessage(playerid, COLOR_WHITE, "Benutzung: /speichern [Geldbetrag]");
               return 1;
             }
          moneys = strval(tmp);
         if(GetPlayerMoney(playerid) < moneys)
            {
               moneys = GetPlayerMoney(playerid);
            }
         GivePlayerMoney(playerid, 0-moneys);
         bank[playerid]+=moneys;
         format(string, sizeof(string), "Du hast %d$ gespeichert, dein Kontostand lautet: %d$", mone
ys, bank[playerid]);
         SendClientMessage(playerid, COLOR_YELLOW, string);
         return 1;
      }


   if(strcmp(cmd, "/abheben", true) == 0)
      {
         new string[256];
         new moneys;
          new tmp[256];
          tmp = strtok(cmdtext, idx);
          
          if(!strlen(tmp))
            {
               SendClientMessage(playerid, COLOR_WHITE, "Benutzung: /abheben [Geldbetrag]");
               return 1;
             }
             
          moneys = strval(tmp);
          
          if(moneys > bank[playerid])
                 moneys = bank[playerid];

         GivePlayerMoney(playerid, moneys);
         bank[playerid] -= moneys;
         format(string, sizeof(string), "Du hast %d$ abgehoben, dein Kontostand lautet: %d$", moneys
, bank[playerid]);
         SendClientMessage(playerid, COLOR_YELLOW, string);
         return 1;
         }


   if(strcmp(cmd, "/konto", true) == 0)
      {
         new string[256];
         format(string, sizeof(string), "Dein Kontostand lautet: %d$", bank[playerid]);
         SendClientMessage(playerid, COLOR_YELLOW, string);
         return 1;
       }
   return 0;
}


stock PlayerName(playerid)
{
   new name[MAX_PLAYER_NAME];
   GetPlayerName(playerid, name, MAX_PLAYER_NAME);
   return name;
}

public OnPlayerConnect(playerid)
{
    if (!udb_Exists(PlayerName(playerid)))
       {
          new fname[MAX_STRING];

          format(fname,sizeof(fname),"%s.sav",udb_encode(PlayerName(playerid)));
          dini_Create(fname);
       }
    if (udb_Exists(PlayerName(playerid)))
       {
      bank[playerid]=dUserINT(PlayerName(playerid)).("bank");
       }
   return 1;
}

public SavedUpdate()
{
   for (new i; i < MAX_PLAYERS; i++)
      {
         if (IsPlayerConnected(i))
            {
               dUserSetINT(PlayerName(i)).("bank",bank[i]);
            }
      }
}

marcel9, 30.07.2008, 11:41
C:\Dokumente und Einstellungen\Marcel\Desktop\Sever\pawno\Untitled.pwn(31) : warning 219: local
variable "bank" shadows a variable at a preceding level
C:\Dokumente und Einstellungen\Marcel\Desktop\Sever\pawno\Untitled.pwn(106) : error 017: undefined
symbol "udb_Exists"
C:\Dokumente und Einstellungen\Marcel\Desktop\Sever\pawno\Untitled.pwn(108) : error 017: undefined
symbol "MAX_STRING"
C:\Dokumente und Einstellungen\Marcel\Desktop\Sever\pawno\Untitled.pwn(108) : error 009: invalid
array size (negative, zero or out of bounds)
C:\Dokumente und Einstellungen\Marcel\Desktop\Sever\pawno\Untitled.pwn(108) : error 036: empty
statement
C:\Dokumente und Einstellungen\Marcel\Desktop\Sever\pawno\Untitled.pwn(108) : fatal error 107: too
many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
marcel9, 30.07.2008, 11:45
Post 1:
Ne habs jezt Dini und dutlis und soo noch definiert und geht

Post 2:
doch wenn mach /speichern 300 macht und dann /konto sagt der: 0? obwohl ich dreihundert gehabt
habe...


-----------
mfg ghost
-----------
eigendlich war von einem account system die rede der bank skript hat aber auch geholfen...
__macrel9___
GTAvision.com :: Forumregeln :: FAQ :: Impressum :: Kontakt :: RDRvision.com :: LANOIREvision.com :: MaxPayneVision.com
NetVisionWork.NET
.: © 2006-2014 by GTAvision.com :.

Rockstar GamesTake-Two Interactive Deutschland

Free Grand Theft Auto Downloads