Jump to content

[OrG][DuDb/dutils]/login/register


Guest RaZoR

Recommended Posts

Takže vám sem dávám tut na Login Register Nikde sem neviděl že by tubyl kdyby tu už byl ak ho mažteDěkujitak deme na to:

Nahoru mezi new adt:

////////////////Include////////////////////////////
#include ///to už v mode asi mate tak si to mužete smazat
#include 
#include 
///////////////Define´s////////////////////////////
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define COLOR_SYSTEM 0xEFEFF7AA
#pragma tabsize 0;
///////////////New´s//////////////////////////////
new PLAYERLIST_authed[MAX_PLAYERS];
////////////If Define´s///////////////////////////:D

 

to by měl byt konec začátku :lol:

ted zas

public OnPlayerConnect(playerid)

tady vtom publicu si najděte poslední return a přejmenujte ho na return false;

a totež si udělejte i v On Player command Text

Posledni return return false;

tak a potom do OnPLayerConect

PLAYERLIST_authed[playerid]=false;

 

tak a potom do OnPLayerDisconect

if (PLAYERLIST_authed[playerid]) {
   dUserSetINT(PlayerName(playerid)).("money",GetPlayerMoney(playerid));
 }
 PLAYERLIST_authed[playerid]=false;

tak a potomsi dejte přesně nad OnPlayerComandText

dcmd_register(playerid,params[]) {

   if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"[Life]Already authed.");

   if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"[Life]Účet už existuje!!!!-Lamo-Přihlaš se příkazem:'/login password'.");

   if (strlen(params)==0) return SystemMsg(playerid,"[Life]Použití: '/register password'");

   if (udb_Create(PlayerName(playerid),params)) return SystemMsg(playerid,"[Life]Účet úspěšně vytvořený přihlaš se:'/login password'.");
   return true;

}


 dcmd_login(playerid,params[]) {
   if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"[Life]Already authed.");

   if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"[Life]Účet Neexistuje zaregistruj se příkazem: '/register password'.");

   if (strlen(params)==0) return SystemMsg(playerid,"[Life]Použití: '/login password'");

   if (udb_CheckLogin(PlayerName(playerid),params)) {

      GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid));

      PLAYERLIST_authed[playerid]=true;

      return SystemMsg(playerid,"[Life]Successfully authed!");
   }
   return SystemMsg(playerid,"[Life]Přihlášení neuspěšné!");
}

a eště do OnPlayerCommandtext

toto:

dcmd(login,5,cmdtext); // min zanku 5
 dcmd(register,8,cmdtext); // max znaku 8

a je to vše pokud nejaka chyba napište prosím Děkuji

 

 

Celý Bytomnelo vypadat takto

 

 

////////////////Include////////////////////////////

#include

#include

#include

///////////////Define´s////////////////////////////

#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#define COLOR_SYSTEM 0xEFEFF7AA

#pragma tabsize 0;

///////////////New´s//////////////////////////////

new PLAYERLIST_authed[MAX_PLAYERS];

////////////If Define´s///////////////////////////:D

#if defined FILTERSCRIPT

 

main()

{

print("\n----------------------------------");

print(" Blank Gamemode by your name here");

print("----------------------------------\n");

}

 

#else

 

 

stock SystemMsg(playerid,msg[]) {

if ((IsPlayerConnected(playerid))&&(strlen(msg)>0)) {

SendClientMessage(playerid,COLOR_SYSTEM,msg);

}

return 1;

}

 

stock PlayerName(playerid) {

new name[255];

GetPlayerName(playerid, name, 255);

return name;

}

 

 

#endif

 

public OnGameModeInit()

{

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 OnPlayerRequestSpawn(playerid)

{

return 1;

}

 

public OnPlayerConnect(playerid)

{

PLAYERLIST_authed[playerid]=false;

return false;

}

 

public OnPlayerDisconnect(playerid, reason)

{

if (PLAYERLIST_authed[playerid]) {

dUserSetINT(PlayerName(playerid)).("money",GetPlayerMoney(playerid));

}

PLAYERLIST_authed[playerid]=false;

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 OnPlayerPrivmsg(playerid, recieverid, text[])

{

return 1;

}

 

dcmd_register(playerid,params[]) {

 

if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"[Life]Already authed.");

 

if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"[Life]Účet už existuje!!!!-Lamo-Přihlaš se příkazem:'/login password'.");

 

if (strlen(params)==0) return SystemMsg(playerid,"[Life]Použití: '/register password'");

 

if (udb_Create(PlayerName(playerid),params)) return SystemMsg(playerid,"[Life]Účet úspěšně vytvořený přihlaš se:'/login password'.");

return true;

 

}

 

 

dcmd_login(playerid,params[]) {

if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"[Life]Already authed.");

 

if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"[Life]Účet Neexistuje zaregistruj se příkazem: '/register password'.");

 

if (strlen(params)==0) return SystemMsg(playerid,"[Life]Použití: '/login password'");

 

if (udb_CheckLogin(PlayerName(playerid),params)) {

 

GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid));

 

PLAYERLIST_authed[playerid]=true;

 

return SystemMsg(playerid,"[Life]Successfully authed!");

}

return SystemMsg(playerid,"[Life]Přihlášení neuspěšné!");

}

 

 

public OnPlayerCommandText(playerid, cmdtext[])

{

if (strcmp("/cheaty", cmdtext, true) == 0)

{

Kick(playerid);

return 1;

}

dcmd(login,5,cmdtext); // min zanku 5

dcmd(register,8,cmdtext); // max znaku 8

 

return false;

}

 

public OnPlayerInfoChange(playerid)

{

return 1;

}

 

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 OnObjectMoved(objectid)

{

return 1;

}

 

public OnPlayerObjectMoved(playerid, objectid)

{

return 1;

}

 

public OnPlayerPickUpPickup(playerid, pickupid)

{

return 1;

}

 

public OnPlayerSelectedMenuRow(playerid, row)

{

return 1;

}

 

public OnPlayerExitedMenu(playerid)

{

return 1;

}

 

 

 

 

Udělán //edit U praven Spoiler l o l Na přání Chytráka :rap:

Link to comment
Share on other sites

  • Replies 205
  • Created
  • Last Reply

Top Posters In This Topic

Jejda :shock: :shock: Chtěl jsem se na to zeptat kámoše jak se to dělá ale nikdy bych nečekal že to bude tak dlouhý. No mě to pomůže hodně ;);)

Link to comment
Share on other sites

Když si to přečteš tak zíštíš že to velký není ale docela težký :-Dale věřím že to dokáž a jestli ne tak mi písni na 372426856 icq,majkyy8 skype

Link to comment
Share on other sites

  • 2 weeks later...
Guest martinek14

C:\DOCUME~1\Sekerka\Plocha\pawno\WIILSN~1.PWN(294) : warning 203: symbol is never used: "dcmd_login"

C:\DOCUME~1\Sekerka\Plocha\pawno\WIILSN~1.PWN(294) : warning 203: symbol is never used: "dcmd_register" pls poradte

Link to comment
Share on other sites

¨jestli myslíš, že když se hráč připojí a nic mu to nenapíše, tak :lol::lol: si tam dej do OnPlayerConnect

 

SendClientMessage(playerid, TVOJE_BARVA, "[ ! ] Zaregistruj se [ /register heslo ]");

SendClientMessage(playerid, TVOJE_BARVA, "[ ! ] Nebo se přihlaš [ /login heslo ]");

 

//edit: opravena hrubka :d

Link to comment
Share on other sites

public OnPlayerRequestSpawn(playerid)

{

if(PLAYERLIST_authed[playerid])

{

return true;

} else {

SendClientMessage(playerid, COLOR_RED, "Ty jeden čůůůůůrááááčkůůůů jdi do píčéé nejsi loglý kokote zrde pičo [POVINNÁ REKLAMA NA http://samp.nazory.cz/");

return false;

}

}

Link to comment
Share on other sites

public OnPlayerRequestSpawn(playerid)

{

if(PLAYERLIST_authed[playerid])

{

return true;

} else {

SendClientMessage(playerid, COLOR_RED, "Ty jeden čůůůůůrááááčkůůůů jdi do píčéé nejsi loglý kokote zrde pičo [POVINNÁ REKLAMA NA http://samp.nazory.cz/" onclick="window.open(this.href);return false;");

return false;

}

}

 

rofl, povinná reklama :d , tak s tutim kdybys něco takovýho napsal mě tak už nežiješ 8-)

Link to comment
Share on other sites

D:\Moje věci\sa mp\00.pwn(247) : error 004: function "PlayerName" is not implemented

D:\Moje věci\sa mp\00.pwn(254) : error 004: function "SystemMsg" is not implemented

D:\Moje věci\sa mp\00.pwn(256) : error 004: function "PlayerName" is not implemented

D:\Moje věci\sa mp\00.pwn(256) : error 004: function "SystemMsg" is not implemented

D:\Moje věci\sa mp\00.pwn(258) : error 004: function "SystemMsg" is not implemented

D:\Moje věci\sa mp\00.pwn(260) : error 004: function "PlayerName" is not implemented

D:\Moje věci\sa mp\00.pwn(260) : error 004: function "SystemMsg" is not implemented

D:\Moje věci\sa mp\00.pwn(267) : error 004: function "SystemMsg" is not implemented

D:\Moje věci\sa mp\00.pwn(269) : error 004: function "PlayerName" is not implemented

D:\Moje věci\sa mp\00.pwn(269) : error 004: function "SystemMsg" is not implemented

D:\Moje věci\sa mp\00.pwn(271) : error 004: function "SystemMsg" is not implemented

D:\Moje věci\sa mp\00.pwn(273) : error 004: function "PlayerName" is not implemented

D:\Moje věci\sa mp\00.pwn(275) : error 004: function "PlayerName" is not implemented

D:\Moje věci\sa mp\00.pwn(279) : error 004: function "SystemMsg" is not implemented

D:\Moje věci\sa mp\00.pwn(281) : error 004: function "SystemMsg" is not implemented

D:\Moje věci\sa mp\00.pwn(2059) : error 021: symbol already defined: "strtok"

D:\Moje věci\sa mp\00.pwn(2074) : error 047: array sizes do not match, or destination array is too small

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

 

 

17 Errors.

Link to comment
Share on other sites

dcmd_register(playerid,params[]) {

   if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"[Life]Already authed.");

   if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"[Life]Účet už existuje!!!!-Lamo-Přihlaš se příkazem:'/login password'.");

   if (strlen(params)==0) return SystemMsg(playerid,"[Life]Použití: '/register password'");

   if (udb_Create(PlayerName(playerid),params)) return SystemMsg(playerid,"[Life]Účet úspěšně vytvořený přihlaš se:'/login password'.");
   return true;

}


 dcmd_login(playerid,params[]) {
   if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"[Life]Already authed.");

   if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"[Life]Účet Neexistuje zaregistruj se příkazem: '/register password'.");

   if (strlen(params)==0) return SystemMsg(playerid,"[Life]Použití: '/login password'");

   if (udb_CheckLogin(PlayerName(playerid),params)) {

      GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid));

      PLAYERLIST_authed[playerid]=true;

      return SystemMsg(playerid,"[Life]Successfully authed!");
   }
   return SystemMsg(playerid,"[Life]Přihlášení neuspěšné!");
}

Link to comment
Share on other sites

  • 5 months later...
  • 3 weeks later...

hmm bohužel s timdle nvm :d

C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(40) : error 026: no matching "#if..."
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(76) : error 017: undefined symbol "PlayerName"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(123) : error 017: undefined symbol "dcmd_login"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(129) : error 017: undefined symbol "dcmd_register"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(133) : error 017: undefined symbol "dcmd_register"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(136) : error 017: undefined symbol "SystemMsg"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(138) : error 017: undefined symbol "PlayerName"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(138) : error 017: undefined symbol "SystemMsg"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(140) : error 017: undefined symbol "params"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(140) : error 017: undefined symbol "SystemMsg"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(142) : error 017: undefined symbol "PlayerName"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(142) : error 017: undefined symbol "SystemMsg"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(148) : warning 225: unreachable code
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(148) : error 017: undefined symbol "dcmd_login"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(150) : error 017: undefined symbol "SystemMsg"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(152) : error 017: undefined symbol "PlayerName"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(152) : error 017: undefined symbol "SystemMsg"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(154) : error 017: undefined symbol "params"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(154) : error 017: undefined symbol "SystemMsg"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(156) : error 017: undefined symbol "PlayerName"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(158) : error 017: undefined symbol "PlayerName"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(162) : error 017: undefined symbol "SystemMsg"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(164) : error 017: undefined symbol "SystemMsg"
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(168) : warning 225: unreachable code
C:\Documents and Settings\Luboš\Plocha\thepimp.pwn(170) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


23 Errors.

Link to comment
Share on other sites

chybí ti #if defined FILTERSCRIPt - pokud je to mod tak si tam najdi nahoře ty věci jako else a #endif a smaž je... a to ostatní to je :

 

stock SystemMsg(playerid,msg[]) {

if ((IsPlayerConnected(playerid))&&(strlen(msg)>0)) {

SendClientMessage(playerid,COLOR_SYSTEM,msg);

}

return 1;

}

 

stock PlayerName(playerid) {

new name[255];

GetPlayerName(playerid, name, 255);

return name;

}

 

nad main()

Link to comment
Share on other sites

kurník to je dlouhý :d něco lehčiho není ?

 

uz jen

C:\DOCUME~1\LUBO~1\Plocha\thepimp.pwn(132) : error 017: undefined symbol "dcmd_login"
C:\DOCUME~1\LUBO~1\Plocha\thepimp.pwn(138) : error 017: undefined symbol "dcmd_register"
C:\DOCUME~1\LUBO~1\Plocha\thepimp.pwn(141) : error 017: undefined symbol "dcmd_register"
C:\DOCUME~1\LUBO~1\Plocha\thepimp.pwn(147) : error 017: undefined symbol "params"
C:\DOCUME~1\LUBO~1\Plocha\thepimp.pwn(149) : error 017: undefined symbol "params"
C:\DOCUME~1\LUBO~1\Plocha\thepimp.pwn(155) : warning 225: unreachable code
C:\DOCUME~1\LUBO~1\Plocha\thepimp.pwn(155) : error 017: undefined symbol "dcmd_login"
C:\DOCUME~1\LUBO~1\Plocha\thepimp.pwn(160) : error 017: undefined symbol "params"
C:\DOCUME~1\LUBO~1\Plocha\thepimp.pwn(162) : error 017: undefined symbol "params"
C:\DOCUME~1\LUBO~1\Plocha\thepimp.pwn(175) : warning 225: unreachable code
C:\DOCUME~1\LUBO~1\Plocha\thepimp.pwn(177) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


9 Errors.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...