Jump to content
  • 0

pomoc REGISTRACE DO MODU


Daffy

Dotaz

Tady mate TuT na registrace pomoci techto dvou includu

 

DUDB http://rocktown.gtasa.cz/downloads.php?cat_id=4&download_id=10

Dutils http://rocktown.gtasa.cz/downloads.php?cat_id=4&download_id=11

NAHORU DO MODU

 

#include 
#include 
#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
new PLAYERLIST_authed[MAX_PLAYERS];

 

TEZ NEKAM TAM ...MAIN NEBO TAM NEKAM

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;
}

do public onplayerconnect vlozime toto :

 

PLAYERLIST_authed[playerid]=false;

do PUBLIC onplayerdisconnect

 

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

 

UPOZORNENI PRO kryspina ...TOTO MEZI PUBLICI NE DO PUBLICU

 

*
*  /register password
*
*/
dcmd_register(playerid,params[]) {
// The command shouldn't work if we already are authed
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");
// The command shouldn't work if an account with this
// kdyz nick uz existuje
if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account already exists, please use '/login password'.");
// Did he forgot the password?
if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/register password'");
// We save the money to the accstate
if (udb_Create(PlayerName(playerid),params)) return SystemMsg(playerid,"Account successfully created. Login with '/login password' now.");
return true;
}
dcmd_login(playerid,params[]) {
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");
// kdyz nick neexistuje
if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account doesn't exist, please use '/register password'.");
// kdyz nezada heslo
if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/login password'");
if (udb_CheckLogin(PlayerName(playerid),params)) {
// prikazy provedene pri uspesnem loginu
GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid));
PLAYERLIST_authed[playerid]=true;
return SystemMsg(playerid,"Successfully authed!");
}
// prihlaseni neuspesne
return SystemMsg(playerid,"Login failed!");
}

A TED DO PUBLIC ON PLAYER COMMAND TEXT

 

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

 

POKUD HAZI ERRORY PISTE ...DOUFAM ZE SEM NA NIC NEZAPOMEL A JINAK ...prikaz login a register v dcmd vlozte nejlepe nad public onplayercommand ( teda aspon ja to tak delam ) ...

Link to comment
Share on other sites

  • Answers 90
  • Created
  • Last Reply

Top Posters For This Question

Recommended Posts

  • 0

Nic moc no....

 

 

C:\samp02Xserver.win32\gamemodes\d21.pwn(78) : warning 217: loose indentation

C:\samp02Xserver.win32\gamemodes\d21.pwn(82) : error 010: invalid function or declaration

C:\samp02Xserver.win32\gamemodes\d21.pwn(88) : error 017: undefined symbol "SystemMsg"

C:\samp02Xserver.win32\gamemodes\d21.pwn(91) : error 017: undefined symbol "PlayerName"

C:\samp02Xserver.win32\gamemodes\d21.pwn(91) : error 017: undefined symbol "SystemMsg"

C:\samp02Xserver.win32\gamemodes\d21.pwn(93) : error 017: undefined symbol "SystemMsg"

C:\samp02Xserver.win32\gamemodes\d21.pwn(95) : error 017: undefined symbol "PlayerName"

C:\samp02Xserver.win32\gamemodes\d21.pwn(95) : error 017: undefined symbol "SystemMsg"

C:\samp02Xserver.win32\gamemodes\d21.pwn(99) : error 017: undefined symbol "SystemMsg"

C:\samp02Xserver.win32\gamemodes\d21.pwn(101) : error 017: undefined symbol "PlayerName"

C:\samp02Xserver.win32\gamemodes\d21.pwn(101) : error 017: undefined symbol "SystemMsg"

C:\samp02Xserver.win32\gamemodes\d21.pwn(103) : error 017: undefined symbol "SystemMsg"

C:\samp02Xserver.win32\gamemodes\d21.pwn(104) : error 017: undefined symbol "PlayerName"

C:\samp02Xserver.win32\gamemodes\d21.pwn(106) : error 017: undefined symbol "PlayerName"

C:\samp02Xserver.win32\gamemodes\d21.pwn(108) : error 017: undefined symbol "SystemMsg"

C:\samp02Xserver.win32\gamemodes\d21.pwn(111) : error 017: undefined symbol "SystemMsg"

C:\samp02Xserver.win32\gamemodes\d21.pwn(118) : error 017: undefined symbol "PlayerName"

C:\samp02Xserver.win32\gamemodes\d21.pwn(121) : warning 217: loose indentation

C:\samp02Xserver.win32\gamemodes\d21.pwn(173) : warning 217: loose indentation

C:\samp02Xserver.win32\gamemodes\d21.pwn(175) : warning 217: loose indentation

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

 

 

16 Errors.

 

Link to comment
Share on other sites

  • 0

 

#include

#include

#include

#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

 

 

new PLAYERLIST_authed[MAX_PLAYERS];

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;

}

 

 

 

main()

{

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

print("| Boot Realny Zivot |");

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

{

return 1;

}

 

public OnPlayerConnect(playerid)

{

PLAYERLIST_authed[playerid]=false;

return 1;

 

}

 

dcmd_register(playerid,params[]) {

// The command shouldn't work if we already are authed

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

// The command shouldn't work if an account with this

// kdyz nick uz existuje

if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account already exists, please use '/login password'.");

// Did he forgot the password?

if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/register password'");

// We save the money to the accstate

if (udb_Create(PlayerName(playerid),params)) return SystemMsg(playerid,"Account successfully created. Login with '/login password' now.");

return true;

}

dcmd_login(playerid,params[]) {

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

// kdyz nick neexistuje

if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account doesn't exist, please use '/register password'.");

// kdyz nezada heslo

if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/login password'");

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

// prikazy provedene pri uspesnem loginu

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

PLAYERLIST_authed[playerid]=true;

return SystemMsg(playerid,"Successfully authed!");

}

// prihlaseni neuspesne

return SystemMsg(playerid,"Login failed!");

}

 

public OnPlayerDisconnect(playerid, reason)

{

if (PLAYERLIST_authed[playerid])

{

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

}

PLAYERLIST_authed[playerid]=false;

return 1;

}

 

public OnPlayerSpawn(playerid)

{

new nahoda;

nahoda=random(3);

switch(nahoda) {

case 0: {

SetPlayerPos(playerid,1958.3783, 1343.1572, 15.3746);

}

case 1: {

SetPlayerPos(playerid,1958.3783, 1343.1572, 15.3746);

}

case 2: {

SetPlayerPos(playerid,1958.3783, 1343.1572, 15.3746);

}}

 

}

 

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;

}

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

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

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 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;

}

 

Link to comment
Share on other sites

  • 0
Guest 25stenli75

cawte ani nwm co mam robit stale mi to pise 1 chybu som lama pawno a newem to este opravit...

 

D:\DOCUME~1\P@KO~1\Plocha\KUHRAM~1\samp\saleny.pwn(727) : error 021: symbol already defined: "PlayerName"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

 

 

1 Error.

 

stock PlayerName(playerid)

{

 

dakujem za pomoc

Link to comment
Share on other sites

  • 0
Guest 25stenli75

1. robim prvy mod v zivote

2. ty si prvy mod iste cely mal copy alebo ti ho niekto iny urobil

3. noaco ze je to stary topic chcem si to dat do modu

4. uz som si tu chybu opravil

Link to comment
Share on other sites

  • 0
Guest 25stenli75

vies ja niektore veci skopcim ale potom si ich v mode upravim... neje vsetko presne take iste...

kazdy nejako zacinal mna nema kto naucit ucim sa sam..

ked sa nebudem pytat ako co mam opravit nikdy sa nenaucim si to opravit sam

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...