[Pomoc] Admin

Započeo JusT, Septembar 07, 2011, 12:15:27 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

JusT

Skripta koju koristim:Columbus(moja od 0)
Detaljan opis problema:Kako da napravim kad se netko connectuje ako je admin da mu pise da je prijavljen kao admin?
Dio skripte:///
Neke slike/video za lakse dobivanje pomoci(neobavezno)://

pod

public OnPlayerLogin

ubaci ovo:

if (PlayerInfo[playerid][pAdmin] > 0)
{
format(string3, sizeof(string3), "Logiran si kao nivo %d Admina",PlayerInfo[playerid][pAdmin]);
SendClientMessage(playerid, COLOR_VERYRED,string3);
format(string3, sizeof(string3), " Admin %s [%d] Usao na server!.", playername2, PlayerInfo[playerid][pAdmin]);
SendAdminMessage(COLOR_LIGHTBLUE,string3);
}



JusT

errori  :( :( :(


error 017: undefined symbol "string3"
error 017: undefined symbol "string3"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

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


4 Errors.

dragan12

Citat: JusTSaYOmG poslato Septembar 07, 2011, 13:36:52 POSLE PODNE
errori  :( :( :(


error 017: undefined symbol "string3"
error 017: undefined symbol "string3"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

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


4 Errors.

Ako nz sta to znaci onda nemoj lagati da je tvoj mod od 0 ili ako ga radis, a nz.  Nisi definisao string tacnije new string3[128]; dodas tu.

JusT

#include <a_samp>
#include bm_moneytd
#include <dini>
#include <dudb>

new Text:Textdraw0;
new Text:Textdraw1;


forward PayDay();
forward OnPlayerLogin(playerid,password[]);

#pragma unused ret_memcpy
#pragma tabsize 0

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIME 0x10F441AA
#define COLOR_MAGENTA 0xFF00FFFF
#define COLOR_NAVY 0x000080AA
#define COLOR_AQUA 0xF0F8FFAA
#define COLOR_CRIMSON 0xDC143CAA
#define COLOR_FLBLUE 0x6495EDAA
#define COLOR_BISQUE 0xFFE4C4AA
#define COLOR_BLACK 0x000000AA
#define COLOR_CHARTREUSE 0x7FFF00AA
#define COLOR_BROWN 0XA52A2AAA
#define COLOR_CORAL 0xFF7F50AA
#define COLOR_GOLD 0xB8860BAA
#define COLOR_GREENYELLOW 0xADFF2FAA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_IVORY 0xFFFF82AA
#define COLOR_LAWNGREEN 0x7CFC00AA
#define COLOR_LIMEGREEN 0x32CD32AA //<--- Dark lime
#define COLOR_MIDNIGHTBLUE 0X191970AA
#define COLOR_MAROON 0x800000AA
#define COLOR_OLIVE 0x808000AA
#define COLOR_ORANGERED 0xFF4500AA
#define COLOR_PINK 0xFFC0CBAA // - Light light pink
#define COLOR_SEAGREEN 0x2E8B57AA
#define COLOR_SPRINGGREEN 0x00FF7FAA
#define COLOR_TOMATO 0xFF6347AA // - Tomato >:/ sounds wrong lol... well... :P
#define COLOR_YELLOWGREEN 0x9ACD32AA //- like military green
#define COLOR_MEDIUMAQUA 0x83BFBFAA
#define COLOR_MEDIUMMAGENTA 0x8B008BAA // dark magenta ^^
#define COLOR_YELLOW 0xDABB3EAA
#define SERVER_USER_FILE "igraci/%s.ini"
///
enum pInfo
{
   pAdminLevel,
   pCash,
   pScore,
   pSkill,
   pLevel,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
new gPlayerLogged[MAX_PLAYERS];

///
main()
{
print("\n----------------------------------");
print(" Columbus DM by JusTSaYOmG");
print("----------------------------------\n");
}

public OnGameModeInit()
{
   Textdraw0 = TextDrawCreate(24.000000, 309.000000, "~r~Columb~b~us");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 0);
TextDrawLetterSize(Textdraw0, 0.689999, 3.000000);
TextDrawColor(Textdraw0, -1);
TextDrawSetOutline(Textdraw0, 0);
TextDrawSetProportional(Textdraw0, 1);
TextDrawSetShadow(Textdraw0, 1);
//Mrtav
Textdraw1 = TextDrawCreate(270.000000, 170.000000, "~r~Mrtav");
TextDrawBackgroundColor(Textdraw1, 255);
TextDrawFont(Textdraw1, 0);
TextDrawLetterSize(Textdraw1, 0.900000, 4.099999);
TextDrawColor(Textdraw1, -1);
TextDrawSetOutline(Textdraw1, 0);
TextDrawSetProportional(Textdraw1, 1);
TextDrawSetShadow(Textdraw1, 1);
//
SetGameModeText("CDM by JusTSaYOmG ");
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)
{
   gPlayerLogged[playerid] = 0;
   new name[MAX_PLAYER_NAME], file[256];
   GetPlayerName(playerid, name, sizeof(name));
   format(file, sizeof(file), SERVER_USER_FILE, name);
   if (!dini_Exists(file))
   {
       ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{F50247}Niste registrovani", "{22D8E6}Dobrodosli, niste registrovani. Molim registrujte se da bi mogli igrati", "Registruj", "Odustani");
   }
   if(fexist(file))
   {
       ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{F50247}Vi ste registrovani", "{22D8E6}Dobrodosli, vi ste registrovani. Logirajte se", "Logiraj", "Odustani");
   }
   return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
   new name[MAX_PLAYER_NAME], file[256];
   GetPlayerName(playerid, name, sizeof(name));
   format(file, sizeof(file), SERVER_USER_FILE, name);
   if(gPlayerLogged[playerid] == 1)
   {
       dini_IntSet(file, "Level", PlayerInfo[playerid][pScore]);
       dini_IntSet(file, "Novac", PlayerInfo[playerid][pCash]);
       dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
       dini_IntSet(file, "Skill Poeni",PlayerInfo[playerid][pSkill]);
   }
   gPlayerLogged[playerid] = 0;
   TextDrawShowForPlayer(playerid, Textdraw0);
return 1;
}

public OnPlayerSpawn(playerid)
{
   TextDrawShowForPlayer(playerid, Textdraw0);
   TextDrawHideForPlayer(playerid, Textdraw1);
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    TextDrawShowForPlayer(playerid, Textdraw1);
    GivePlayerMoney(playerid, -1500);
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public PayDay() {
for (new i = 0; i < MAX_PLAYERS; i++) {
   SendClientMessage(i,COLOR_LIGHTBLUE,"|________Columbus PayDay________|");
SendClientMessage(i,COLOR_LIGHTBLUE,"Hvala sto igrate na nasem Serveru!");
SendClientMessage(i,COLOR_LIGHTBLUE,"Nagrada za to je 50000 $");
SendClientMessage(i,COLOR_LIGHTBLUE,"_____________________________________");
GivePlayerMoney(i,50000);
}
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN, "Ubio si se!!!");
return 1;
}
if (strcmp("/gun", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid, 24, 100);
SendClientMessage(playerid, COLOR_BLUE, "Uzeo si oruzije!!");
return 1;
}
if (strcmp("/heal", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid,100.0);
return 1;
}
if (strcmp("/help", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_RED, "Komande : /kill /heal /gun ");
return 1;
}
   if (strcmp("/payday", cmdtext, true, 10) == 0)
{
if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdminLevel] == 1338)
{
PayDay();
}
else
{
//SendClientMessage(playerid, COLOR_GRAD1, "{FFFFFF}[{F81414}ColumbusAS{FFFFFF}]{CCCCCC}Admini samo!");
}
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 == 1)
   {
       new name[MAX_PLAYER_NAME], file[256], string[128];
       GetPlayerName(playerid, name, sizeof(name));
       format(file, sizeof(file), SERVER_USER_FILE, name);
       if(!response) return Kick(playerid);
       if (!strlen(inputtext)) return
       ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{F50247}Niste registrovani", "{22D8E6}Dobrodosli, niste registrovani. Molim registrujte se da bi mogli igrati", "Registruj", "Odustani");
       dini_Create(file);
       dini_IntSet(file, "Lozinka", udb_hash(inputtext));
       dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel] = 0);
       dini_IntSet(file, "Novci",PlayerInfo[playerid][pCash] = 500);
       dini_IntSet(file, "Level",PlayerInfo[playerid][pScore] = 0);
       format(string, 128, "Registrirali ste se %s s sifrom %s, automatski ste logirani.", name, inputtext);
       SendClientMessage(playerid, COLOR_YELLOW, string);
       gPlayerLogged[playerid] = 1;
   }
if (dialogid == 2)
   {
       new name[MAX_PLAYER_NAME], file[256];
       GetPlayerName(playerid, name, sizeof(name));
       format(file, sizeof(file), SERVER_USER_FILE, name);
       if(!response) return Kick(playerid);
       if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{F50247}Vi ste registrovani", "{22D8E6}Dobrodosli, vi ste registrovani. Logirajte se", "Logiraj", "Odustani");
       new tmp;
       tmp = dini_Int(file, "Lozinka");
       if(udb_hash(inputtext) != tmp) {
           SendClientMessage(playerid, COLOR_RED, "Pogresna lozinka.");
           ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{F50247}Vi ste registrovani", "{22D8E6}Dobrodosli, vi ste registrovani. Logirajte se", "Logiraj", "Odustani");
       }
       else
       {
           gPlayerLogged[playerid] = 1;
           PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel");
           SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
           GivePlayerMoney(playerid, dini_Int(file, "Novci")-GetPlayerMoney(playerid));
           SendClientMessage(playerid,COLOR_RED, "Logirani ste!!");
       }
   }
return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}


Eo vidis da je od 0

EDIT:2 errora

Citatundefined symbol "playername2"
undefined symbol "SendAdminMessage"
Poslednja Izmena: Septembar 07, 2011, 13:49:07 POSLE PODNE od JusTSaYOmG

a je tesko promijenit ime :)

forward SendAdminMessage(color, string[]);


i pod public dodaj:

public SendAdminMessage(color, string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pAdmin] >= 1)
    {
SendClientMessage(i, color, string);
}
}
}
}

Citat: JusTSaYOmG poslato Septembar 07, 2011, 13:45:39 POSLE PODNE
#include <a_samp>
#include bm_moneytd
#include <dini>
#include <dudb>

new Text:Textdraw0;
new Text:Textdraw1;


forward PayDay();
forward OnPlayerLogin(playerid,password[]);

#pragma unused ret_memcpy
#pragma tabsize 0

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIME 0x10F441AA
#define COLOR_MAGENTA 0xFF00FFFF
#define COLOR_NAVY 0x000080AA
#define COLOR_AQUA 0xF0F8FFAA
#define COLOR_CRIMSON 0xDC143CAA
#define COLOR_FLBLUE 0x6495EDAA
#define COLOR_BISQUE 0xFFE4C4AA
#define COLOR_BLACK 0x000000AA
#define COLOR_CHARTREUSE 0x7FFF00AA
#define COLOR_BROWN 0XA52A2AAA
#define COLOR_CORAL 0xFF7F50AA
#define COLOR_GOLD 0xB8860BAA
#define COLOR_GREENYELLOW 0xADFF2FAA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_IVORY 0xFFFF82AA
#define COLOR_LAWNGREEN 0x7CFC00AA
#define COLOR_LIMEGREEN 0x32CD32AA //<--- Dark lime
#define COLOR_MIDNIGHTBLUE 0X191970AA
#define COLOR_MAROON 0x800000AA
#define COLOR_OLIVE 0x808000AA
#define COLOR_ORANGERED 0xFF4500AA
#define COLOR_PINK 0xFFC0CBAA // - Light light pink
#define COLOR_SEAGREEN 0x2E8B57AA
#define COLOR_SPRINGGREEN 0x00FF7FAA
#define COLOR_TOMATO 0xFF6347AA // - Tomato >:/ sounds wrong lol... well... :P
#define COLOR_YELLOWGREEN 0x9ACD32AA //- like military green
#define COLOR_MEDIUMAQUA 0x83BFBFAA
#define COLOR_MEDIUMMAGENTA 0x8B008BAA // dark magenta ^^
#define COLOR_YELLOW 0xDABB3EAA
#define SERVER_USER_FILE "igraci/%s.ini"
///
enum pInfo
{
   pAdminLevel,
   pCash,
   pScore,
   pSkill,
   pLevel,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
new gPlayerLogged[MAX_PLAYERS];

///
main()
{
print("\n----------------------------------");
print(" Columbus DM by JusTSaYOmG");
print("----------------------------------\n");
}

public OnGameModeInit()
{
   Textdraw0 = TextDrawCreate(24.000000, 309.000000, "~r~Columb~b~us");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 0);
TextDrawLetterSize(Textdraw0, 0.689999, 3.000000);
TextDrawColor(Textdraw0, -1);
TextDrawSetOutline(Textdraw0, 0);
TextDrawSetProportional(Textdraw0, 1);
TextDrawSetShadow(Textdraw0, 1);
//Mrtav
Textdraw1 = TextDrawCreate(270.000000, 170.000000, "~r~Mrtav");
TextDrawBackgroundColor(Textdraw1, 255);
TextDrawFont(Textdraw1, 0);
TextDrawLetterSize(Textdraw1, 0.900000, 4.099999);
TextDrawColor(Textdraw1, -1);
TextDrawSetOutline(Textdraw1, 0);
TextDrawSetProportional(Textdraw1, 1);
TextDrawSetShadow(Textdraw1, 1);
//
SetGameModeText("CDM by JusTSaYOmG ");
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)
{
   gPlayerLogged[playerid] = 0;
   new name[MAX_PLAYER_NAME], file[256];
   GetPlayerName(playerid, name, sizeof(name));
   format(file, sizeof(file), SERVER_USER_FILE, name);
   if (!dini_Exists(file))
   {
       ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{F50247}Niste registrovani", "{22D8E6}Dobrodosli, niste registrovani. Molim registrujte se da bi mogli igrati", "Registruj", "Odustani");
   }
   if(fexist(file))
   {
       ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{F50247}Vi ste registrovani", "{22D8E6}Dobrodosli, vi ste registrovani. Logirajte se", "Logiraj", "Odustani");
   }
   return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
   new name[MAX_PLAYER_NAME], file[256];
   GetPlayerName(playerid, name, sizeof(name));
   format(file, sizeof(file), SERVER_USER_FILE, name);
   if(gPlayerLogged[playerid] == 1)
   {
       dini_IntSet(file, "Level", PlayerInfo[playerid][pScore]);
       dini_IntSet(file, "Novac", PlayerInfo[playerid][pCash]);
       dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
       dini_IntSet(file, "Skill Poeni",PlayerInfo[playerid][pSkill]);
   }
   gPlayerLogged[playerid] = 0;
   TextDrawShowForPlayer(playerid, Textdraw0);
return 1;
}

public OnPlayerSpawn(playerid)
{
   TextDrawShowForPlayer(playerid, Textdraw0);
   TextDrawHideForPlayer(playerid, Textdraw1);
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    TextDrawShowForPlayer(playerid, Textdraw1);
    GivePlayerMoney(playerid, -1500);
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public PayDay() {
for (new i = 0; i < MAX_PLAYERS; i++) {
   SendClientMessage(i,COLOR_LIGHTBLUE,"|________Columbus PayDay________|");
SendClientMessage(i,COLOR_LIGHTBLUE,"Hvala sto igrate na nasem Serveru!");
SendClientMessage(i,COLOR_LIGHTBLUE,"Nagrada za to je 50000 $");
SendClientMessage(i,COLOR_LIGHTBLUE,"_____________________________________");
GivePlayerMoney(i,50000);
}
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN, "Ubio si se!!!");
return 1;
}
if (strcmp("/gun", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid, 24, 100);
SendClientMessage(playerid, COLOR_BLUE, "Uzeo si oruzije!!");
return 1;
}
if (strcmp("/heal", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid,100.0);
return 1;
}
if (strcmp("/help", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_RED, "Komande : /kill /heal /gun ");
return 1;
}
   if (strcmp("/payday", cmdtext, true, 10) == 0)
{
if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdminLevel] == 1338)
{
PayDay();
}
else
{
//SendClientMessage(playerid, COLOR_GRAD1, "{FFFFFF}[{F81414}ColumbusAS{FFFFFF}]{CCCCCC}Admini samo!");
}
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 == 1)
   {
       new name[MAX_PLAYER_NAME], file[256], string[128];
       GetPlayerName(playerid, name, sizeof(name));
       format(file, sizeof(file), SERVER_USER_FILE, name);
       if(!response) return Kick(playerid);
       if (!strlen(inputtext)) return
       ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{F50247}Niste registrovani", "{22D8E6}Dobrodosli, niste registrovani. Molim registrujte se da bi mogli igrati", "Registruj", "Odustani");
       dini_Create(file);
       dini_IntSet(file, "Lozinka", udb_hash(inputtext));
       dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel] = 0);
       dini_IntSet(file, "Novci",PlayerInfo[playerid][pCash] = 500);
       dini_IntSet(file, "Level",PlayerInfo[playerid][pScore] = 0);
       format(string, 128, "Registrirali ste se %s s sifrom %s, automatski ste logirani.", name, inputtext);
       SendClientMessage(playerid, COLOR_YELLOW, string);
       gPlayerLogged[playerid] = 1;
   }
if (dialogid == 2)
   {
       new name[MAX_PLAYER_NAME], file[256];
       GetPlayerName(playerid, name, sizeof(name));
       format(file, sizeof(file), SERVER_USER_FILE, name);
       if(!response) return Kick(playerid);
       if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{F50247}Vi ste registrovani", "{22D8E6}Dobrodosli, vi ste registrovani. Logirajte se", "Logiraj", "Odustani");
       new tmp;
       tmp = dini_Int(file, "Lozinka");
       if(udb_hash(inputtext) != tmp) {
           SendClientMessage(playerid, COLOR_RED, "Pogresna lozinka.");
           ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{F50247}Vi ste registrovani", "{22D8E6}Dobrodosli, vi ste registrovani. Logirajte se", "Logiraj", "Odustani");
       }
       else
       {
           gPlayerLogged[playerid] = 1;
           PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel");
           SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
           GivePlayerMoney(playerid, dini_Int(file, "Novci")-GetPlayerMoney(playerid));
           SendClientMessage(playerid,COLOR_RED, "Logirani ste!!");
       }
   }
return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}


Eo vidis da je od 0

EDIT:2 errora

Citatundefined symbol "playername2"
undefined symbol "SendAdminMessage"

GetPlayerName(playerid, playername2, sizeof(playername2));


Server IP: 193.192.58.82:7782
Forum: www.balkan-underline.info


dragan12

@Mazalovic
Pogresio si kod SendAdminMessage
Ovako ide oba:

new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));





forward SendAdminMessage(color, string[]);
public SendAdminMessage(color, string[])
{
foreach (Player, i)
{
   if(PlayerInfo[playerid][pAdminLevel] >=)
   {
SendClientMessage(i, color, string);
}
}
}

To ti je oba. A ako radis od 0 koristi za cuvanje djSon ili y_ini ako ih znas.

JusT

error 017: undefined symbol "foreach"
error 017: undefined symbol "playerid"
error 017: undefined symbol "i"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Poslednja Izmena: Septembar 07, 2011, 13:59:17 POSLE PODNE od JusTSaYOmG

dragan12

Citat: JusTSaYOmG poslato Septembar 07, 2011, 13:57:48 POSLE PODNE
error 017: undefined symbol "foreach"
error 017: undefined symbol "playerid"
error 017: undefined symbol "i"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase

Ovaj red:
if(PlayerInfo[playerid][pAdminLevel] >=)

Stavis ovako bio mi je iskljucen Num Lock
if(PlayerInfo[playerid][pAdminLevel] >= 1)

JusT

Jedan error

error 017: undefined symbol "playerid"

dragan12



dragan12

Citat: JusTSaYOmG poslato Septembar 07, 2011, 14:39:29 POSLE PODNE
Citat: Gagi_Corleone poslato Septembar 07, 2011, 14:32:54 POSLE PODNE
Citat: JusTSaYOmG poslato Septembar 07, 2011, 14:02:28 POSLE PODNE
Jedan error

error 017: undefined symbol "playerid"
Umesto playerid stavis i

Gdje kad ih ima 10000
if(PlayerInfo[playerid][pAdminLevel] >= 1)
U tom redu
if(PlayerInfo[i][pAdminLevel] >= 1)
Poslednja Izmena: Septembar 07, 2011, 14:53:46 POSLE PODNE od Gagi_Corleone

JusT

e sad imam jedan error

error 033: array must be indexed (variable "PlayerInfo")