Jump to content
  • 0

pomoc Registrace


TuTaHeDoK

Dotaz

pls, stale sa snazim si spravit register/login podla fora od David, ale stale mi to hadze tieto errory, nevedeli by ste mi s tym pomoct?

 

 

D:\GTA SA\FlowGlass - Pawno\gamemodes\rs.pwn(405) : error 021: symbol already defined: "strtok"

D:\GTA SA\FlowGlass - Pawno\gamemodes\rs.pwn(420) : error 047: array sizes do not match, or destination array is too small

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

 

 

2 Errors.

 

Link to comment
Share on other sites

19 odpovědí na tuto otázku

Recommended Posts

  • 0

K D:\GTA SA\FlowGlass - Pawno\gamemodes\rs.pwn(405) : error 021: symbol already defined: "strtok"

zmaž si z módu stock pre strtok a ukáž viac riadkov

Link to comment
Share on other sites

  • 0

toto mam zmazat?

 

 

stock PlayerName(playerid) {

new name[24];

GetPlayerName(playerid, name, 24);

return name;

}

 

 

alebo toto?

 

 

strtok(const string[], &index)

{

new length = strlen(string);

while ((index < length) && (string[index] <= ' '))

{

index++;

}

 

Link to comment
Share on other sites

  • 0
toto mam zmazat?

 

 

stock PlayerName(playerid) {

new name[24];

GetPlayerName(playerid, name, 24);

return name;

}

 

 

alebo toto?

 

 

strtok(const string[], &index)

{

new length = strlen(string);

while ((index < length) && (string[index] <= ' '))

{

index++;

}

 

new offset = index;

new result[60];

while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))

{

result[index - offset] = string[index];

index++;

}

result[index - offset] = EOS;

return result;

}

To druhé

Link to comment
Share on other sites

  • 0

sorry za blbe otazky ale mam tam trocha neporiadok..

 

to druhe co som ti poslal nwm ci obydve patria do jedneho

 

toto?

 

 

strtok(const string[], &index)

{

new length = strlen(string);

while ((index < length) && (string[index] <= ' '))

{

index++;

}

 

new offset = index;

new result[60];

while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))

{

result[index - offset] = string[index];

index++;

}

result[index - offset] = EOS;

return result;

}

 

 

alebo len toto?

 

 

strtok(const string[], &index)

{

new length = strlen(string);

while ((index < length) && (string[index] <= ' '))

{

index++;

}

 

Link to comment
Share on other sites

  • 0
sorry za blbe otazky ale mam tam trocha neporiadok..

 

to druhe co som ti poslal nwm ci obydve patria do jedneho

 

toto?

 

 

strtok(const string[], &index)

{

new length = strlen(string);

while ((index < length) && (string[index] <= ' '))

{

index++;

}

 

new offset = index;

new result[60];

while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))

{

result[index - offset] = string[index];

index++;

}

result[index - offset] = EOS;

return result;

}

 

 

alebo len toto?

 

 

strtok(const string[], &index)

{

new length = strlen(string);

while ((index < length) && (string[index] <= ' '))

{

index++;

}

Máš v tom dosť bordel... Mohol by si viac zkúsať a pak sa pýtať ked ti to nejde...

Zmaž to druhé

Link to comment
Share on other sites

  • 0

ok, teraz mi nabehlo toto

 

 

D:\GTA SA\FlowGlass - Pawno\pawno\include\dutils.inc(377) : warning 219: local variable "offset" shadows a variable at a preceding level

D:\GTA SA\FlowGlass - Pawno\pawno\include\dutils.inc(378) : warning 219: local variable "result" shadows a variable at a preceding level

D:\GTA SA\FlowGlass - Pawno\gamemodes\rs.pwn(406) : error 010: invalid function or declaration

D:\GTA SA\FlowGlass - Pawno\gamemodes\rs.pwn(412) : error 010: invalid function or declaration

D:\GTA SA\FlowGlass - Pawno\gamemodes\rs.pwn(444) : warning 203: symbol is never used: "offset"

D:\GTA SA\FlowGlass - Pawno\gamemodes\rs.pwn(444) : warning 203: symbol is never used: "result"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

 

 

2 Errors.

 

Link to comment
Share on other sites

  • 0
ok, teraz mi nabehlo toto

 

 

D:\GTA SA\FlowGlass - Pawno\pawno\include\dutils.inc(377) : warning 219: local variable "offset" shadows a variable at a preceding level

D:\GTA SA\FlowGlass - Pawno\pawno\include\dutils.inc(378) : warning 219: local variable "result" shadows a variable at a preceding level

D:\GTA SA\FlowGlass - Pawno\gamemodes\rs.pwn(406) : error 010: invalid function or declaration

D:\GTA SA\FlowGlass - Pawno\gamemodes\rs.pwn(412) : error 010: invalid function or declaration

D:\GTA SA\FlowGlass - Pawno\gamemodes\rs.pwn(444) : warning 203: symbol is never used: "offset"

D:\GTA SA\FlowGlass - Pawno\gamemodes\rs.pwn(444) : warning 203: symbol is never used: "result"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

 

 

2 Errors.

 

 

ti mozno pomozem ale daj tu tie riadky!!

Link to comment
Share on other sites

  • 0

TU to je

 

 

riadok 219: playermoney = GetPlayerMoney(playerid);

riadok 406: while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))

riadok 412: return result;

a riadok 444 mi pise ze:

D:\GTA SA\FlowGlass - Pawno\gamemodes\rs.pwn(444) : warning 203: symbol is never used: "offset"

D:\GTA SA\FlowGlass - Pawno\gamemodes\rs.pwn(444) : warning 203: symbol is never used: "result"

ale pritom posledny riadok je 443 a na nom je: }

 

Link to comment
Share on other sites

  • 0
TU to je

 

 

riadok 219: playermoney = GetPlayerMoney(playerid);

riadok 406: while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))

riadok 412: return result;

a riadok 444 mi pise ze:

D:\GTA SA\FlowGlass - Pawno\gamemodes\rs.pwn(444) : warning 203: symbol is never used: "offset"

D:\GTA SA\FlowGlass - Pawno\gamemodes\rs.pwn(444) : warning 203: symbol is never used: "result"

ale pritom posledny riadok je 443 a na nom je: }

 

ano ale celi ten riadok skopiruj a daj nech ti poviem kde v tom riadku je chyba... chape?? :d

Link to comment
Share on other sites

  • 0

Pocuj ja sem dam cely moj mod a prosimta.. pomoz mi stim serem sa s tim uz cely den .. :/

 

 

#include

#include

#include

 

#pragma unused strtok

#pragma tabsize 0

 

#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 SYSTEM 0xEFEFF7AA

 

#pragma tabsize 0

//---| promenne |

new bool:login[MAX_PLAYERS];

 

 

#define COLOR_GREY 0xAFAFAFAA

#define COLOR_GREEN 0x33AA33AA

#define COLOR_RED 0xAA3333AA

#define COLOR_YELLOW 0xFFFF00AA

#define COLOR_WHITE 0xFFFFFFAA

#define PocketMoney 10000 // Peniaze na Spawne

#define INACTIVE_PLAYER_ID 255

#define GIVECASH_DELAY 5000 // Prikaz /givecash.

 

#define NUMVALUES 4

 

forward MoneyGrubScoreUpdate();

forward Givecashdelaytimer(playerid);

forward SetPlayerRandomSpawn(playerid);

forward SetupPlayerForClassSelection(playerid);

forward GameModeExitFunc();

forward SendPlayerFormattedText(playerid, const str[], define);

forward public SendAllFormattedText(playerid, const str[], define);

 

//------------------------------------------------------------------------------------------------------

 

new CashScoreOld;

new iSpawnSet[MAX_PLAYERS];

 

new Float:gRandomPlayerSpawns[1][3] = {

{1958.3783,1343.1572,15.3746}

};

 

new Float:gCopPlayerSpawns[2][3] = {

{2297.1064,2452.0115,10.8203},

{2297.0452,2468.6743,10.8203}

};

 

//Round čas

//new gRoundTime = 3600000; // Round time - 1 hour

//new gRoundTime = 1200000; // Round time - 20 mins

//new gRoundTime = 900000; // Round time - 15 mins

//new gRoundTime = 600000; // Round time - 10 mins

//new gRoundTime = 300000; // Round time - 5 mins

//new gRoundTime = 120000; // Round time - 2 mins

//new gRoundTime = 60000; // Round time - 1 min

 

new gActivePlayers[MAX_PLAYERS];

new gLastGaveCash[MAX_PLAYERS];

 

//------------------------------------------------------------------------------------------------------

 

main()

{

 

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

print(" * Realny Svet 3.2 *\n");

print(" www.FlowGlass.crew.sk");

print(" CZ/SK");

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

}

 

//------------------------------------------------------------------------------------------------------

 

public OnPlayerRequestSpawn(playerid)

{

SendPlayerFormattedText(playerid, "[ Info ]: Pre pomoc napíš /help", 0);

//printf("OnPlayerRequestSpawn(%d)",playerid);

return 1;

}

 

//------------------------------------------------------------------------------------------------------

 

public OnPlayerPickUpPickup(playerid, pickupid)

{

//new s[256];

//format(s,256,"Picked up %d",pickupid);

//SendClientMessage(playerid,0xFFFFFFFF,s);

}

 

//------------------------------------------------------------------------------------------------------

 

public MoneyGrubScoreUpdate()

{

new CashScore;

new name[MAX_PLAYER_NAME];

//new string[256];

for(new i=0; i

{

if (IsPlayerConnected(i))

{

GetPlayerName(i, name, sizeof(name));

CashScore = GetPlayerMoney(i);

SetPlayerScore(i, CashScore);

if (CashScore > CashScoreOld)

{

CashScoreOld = CashScore;

//format(string, sizeof(string), "$$$ %s is now in the lead $$$", name);

//SendClientMessageToAll(COLOR_YELLOW, string);

}

}

}

}

 

//------------------------------------------------------------------------------------------------------

 

/*public GrubModeReset()

{

for(new i=0; i

{

if (IsPlayerConnected(i))

{

SetPlayerScore(i, PocketMoney);

SetPlayerRandomSpawn(i, classid);

}

}

 

}*/

 

//------------------------------------------------------------------------------------------------------

 

public OnPlayerConnect(playerid)

{

 

login[playerid] = false;

 

GameTextForPlayer(playerid,"Realny Svet 3.2",5000,5);

SendPlayerFormattedText(playerid, "Vitaj na Reálny Svet 3.2 !!!", 0);

SendPlayerFormattedText(playerid,"-----------------------------------------------------------------------", 0);

gActivePlayers[playerid]++;

gLastGaveCash[playerid] = GetTickCount();

return 1;

}

 

//------------------------------------------------------------------------------------------------------

public OnPlayerDisconnect(playerid, reason)

{

 

if (login[playerid])

{

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

}

login[playerid]=false;

 

gActivePlayers[playerid]--;

}

//------------------------------------------------------------------------------------------------------

public OnPlayerCommandText(playerid, cmdtext[])

{

 

dcmd(login, 5, cmdtext);

dcmd(register, 8, cmdtext);

 

new string[256];

new playermoney;

new sendername[MAX_PLAYER_NAME];

new giveplayer[MAX_PLAYER_NAME];

new cmd[256];

new giveplayerid, moneys, idx;

 

cmd = strtok(cmdtext, idx);

 

if(strcmp(cmd, "/help", true) == 0) {

SendClientMessage(playerid, COLOR_GREEN, "Pomoc:");

SendClientMessage(playerid, COLOR_GREY, "* Príkazom /prikazy budú zobrazené príkazy na tohto servera.");

SendClientMessage(playerid, COLOR_GREY, "* Príkazom /givecash [iD Hráča] [sUMA] môžete posielať peniaze.");

SendClientMessage(playerid, COLOR_GREY, "* Príkazom /info získate informácie o tomto móde.");

SendClientMessage(playerid, COLOR_GREY, "-----------------------------------------------------------------------");

return 1;

}

if(strcmp(cmd, "/prikazy", true) == 0) {

SendClientMessage(playerid, COLOR_GREY, "/help /info /prikazy /admins");

SendClientMessage(playerid, COLOR_GREY, "-----------------------------------------------------------------------");

return 1;

}

if(strcmp(cmd, "/info", true) == 0) {

SendPlayerFormattedText(playerid,"* Reálny Svet - 3.2 *",0);

SendPlayerFormattedText(playerid,"Názov módu: Reálny Svet 3.2",0);

SendPlayerFormattedText(playerid,"Náš web: www.FlowGlass.crew.sk",0);

SendPlayerFormattedText(playerid,"Kontakt: [email protected]",0);

SendPlayerFormattedText(playerid,"Skype: Deathigos, teo85101", 0);

SendPlayerFormattedText(playerid,"-----------------------------------------------------------------------", 0);

return 1;

}

 

if(strcmp(cmd, "/givecash", true) == 0) {

new tmp[256];

tmp = strtok(cmdtext, idx);

 

if(!strlen(tmp)) {

SendClientMessage(playerid, COLOR_WHITE, "Napíš: /givecash [iD Hráča] [sUMA]");

return 1;

}

giveplayerid = strval(tmp);

 

tmp = strtok(cmdtext, idx);

if(!strlen(tmp)) {

SendClientMessage(playerid, COLOR_WHITE, "Napíš: /givecash [iD Hráča] [sUMA]");

return 1;

}

moneys = strval(tmp);

 

//printf("givecash_command: %d %d",giveplayerid,moneys);

 

 

if (IsPlayerConnected(giveplayerid)) {

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

GetPlayerName(playerid, sendername, sizeof(sendername));

playermoney = GetPlayerMoney(playerid);

if (moneys > 0 && playermoney >= moneys) {

GivePlayerMoney(playerid, (0 - moneys));

GivePlayerMoney(giveplayerid, moneys);

format(string, sizeof(string), "Poslal si peniaze hráčovi %s(ID: %d), $%d.", giveplayer,giveplayerid, moneys);

SendClientMessage(playerid, COLOR_YELLOW, string);

format(string, sizeof(string), "Dostal si $%d od %s(ID: %d).", moneys, sendername, playerid);

SendClientMessage(giveplayerid, COLOR_YELLOW, string);

printf("%s(playerid:%d) presunuté %d na %s(ID:%d)",sendername, playerid, moneys, giveplayer, giveplayerid);

}

else {

SendClientMessage(playerid, COLOR_YELLOW, "Neplatná suma.");

}

}

else {

format(string, sizeof(string), "%d nie je aktívny.", giveplayerid);

SendClientMessage(playerid, COLOR_YELLOW, string);

}

return 1;

}

 

// PROCESS OTHER COMMANDS

 

 

return false;

}

 

//------------------------------------------------------------------------------------------------------

 

public OnPlayerSpawn(playerid)

{

GivePlayerMoney(playerid, PocketMoney);

SetPlayerInterior(playerid,0);

SetPlayerRandomSpawn(playerid);

TogglePlayerClock(playerid,1);

return 1;

}

 

public SetPlayerRandomSpawn(playerid)

{

if (iSpawnSet[playerid] == 1)

{

new rand = random(sizeof(gCopPlayerSpawns));

SetPlayerPos(playerid, gCopPlayerSpawns[rand][0], gCopPlayerSpawns[rand][1], gCopPlayerSpawns[rand][2]); // Warp

SetPlayerFacingAngle(playerid, 270.0);

}

else if (iSpawnSet[playerid] == 0)

{

new rand = random(sizeof(gRandomPlayerSpawns));

SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); // Warp

}

return 1;

}

 

//------------------------------------------------------------------------------------------------------

 

public OnPlayerDeath(playerid, killerid, reason)

{

SendClientMessage(playerid, COLOR_GREEN, "( ! ) Zomrel si ( ! )");

new playercash;

if(killerid == INVALID_PLAYER_ID) {

SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);

ResetPlayerMoney(playerid);

} else {

SendDeathMessage(killerid,playerid,reason);

SetPlayerScore(killerid,GetPlayerScore(killerid)+1);

playercash = GetPlayerMoney(playerid);

if (playercash > 0) {

GivePlayerMoney(killerid, playercash);

ResetPlayerMoney(playerid);

}

else

{

}

}

return 1;

}

 

/* public OnPlayerDeath(playerid, killerid, reason)

{ haxed by teh mike

new name[MAX_PLAYER_NAME];

new string[256];

new deathreason[20];

new playercash;

GetPlayerName(playerid, name, sizeof(name));

GetWeaponName(reason, deathreason, 20);

if (killerid == INVALID_PLAYER_ID) {

switch (reason) {

case WEAPON_DROWN:

{

format(string, sizeof(string), "*** %s drowned.)", name);

}

default:

{

if (strlen(deathreason) > 0) {

format(string, sizeof(string), "*** %s died. (%s)", name, deathreason);

} else {

format(string, sizeof(string), "*** %s died.", name);

}

}

}

}

else {

new killer[MAX_PLAYER_NAME];

GetPlayerName(killerid, killer, sizeof(killer));

if (strlen(deathreason) > 0) {

format(string, sizeof(string), "*** %s killed %s. (%s)", killer, name, deathreason);

} else {

format(string, sizeof(string), "*** %s killed %s.", killer, name);

}

}

SendClientMessageToAll(COLOR_RED, string);

{

playercash = GetPlayerMoney(playerid);

if (playercash > 0)

{

GivePlayerMoney(killerid, playercash);

ResetPlayerMoney(playerid);

}

else

{

}

}

return 1;

}*/

 

//------------------------------------------------------------------------------------------------------

 

public OnPlayerRequestClass(playerid, classid)

{

iSpawnSet[playerid] = 0;

SetupPlayerForClassSelection(playerid);

return 1;

}

 

public SetupPlayerForClassSelection(playerid)

{

SetPlayerInterior(playerid,14);

SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);

SetPlayerFacingAngle(playerid, 270.0);

SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);

SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);

}

 

public GameModeExitFunc()

{

GameModeExit();

}

 

public OnGameModeInit()

{

SetGameModeText("Realny Svet 3.2");

 

ShowPlayerMarkers(1);

ShowNameTags(1);

EnableStuntBonusForAll(0);

 

// Player Class's

AddPlayerClass(0,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1);

 

// Car Spawns

 

 

SetTimer("MoneyGrubScoreUpdate", 1000, 1);

//SetTimer("GameModeExitFunc", gRoundTime, 0);

 

return 1;

}

 

 

 

public SendPlayerFormattedText(playerid, const str[], define)

{

new tmpbuf[256];

format(tmpbuf, sizeof(tmpbuf), str, define);

SendClientMessage(playerid, 0xFF004040, tmpbuf);

}

 

public SendAllFormattedText(playerid, const str[], define)

{

new tmpbuf[256];

format(tmpbuf, sizeof(tmpbuf), str, define);

SendClientMessageToAll(0xFFFF00AA, tmpbuf);

}

 

new offset = index;

new result[60];

while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))

{

result[index - offset] = string[index];

index++;

}

result[index - offset] = EOS;

return result;

}

 

dcmd_register(playerid,params[])

{

if (login[playerid]) return SendClientMessage(playerid, SYSTEM,"[Life]Already authed.");

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

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

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

return 1;

}

 

 

dcmd_login(playerid,params[])

{

if (login[playerid]) return SendClientMessage(playerid, SYSTEM,"[Life]Already authed.");

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

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

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

{

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

login[playerid]=true;

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

}

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

}

 

stock PlayerName(playerid) {

new name[24];

GetPlayerName(playerid, name, 24);

return name;

}

 

Link to comment
Share on other sites

  • 0

#include 
#include 
#include 

#pragma unused strtok
#pragma tabsize 0

#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 SYSTEM 0xEFEFF7AA

#pragma tabsize 0
//---| promenne |
new bool:login[MAX_PLAYERS];


#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define PocketMoney 10000 // Peniaze na Spawne
#define INACTIVE_PLAYER_ID 255
#define GIVECASH_DELAY 5000 // Prikaz /givecash.

#define NUMVALUES 4

forward MoneyGrubScoreUpdate();
forward Givecashdelaytimer(playerid);
forward SetPlayerRandomSpawn(playerid);
forward SetupPlayerForClassSelection(playerid);
forward GameModeExitFunc();
forward SendPlayerFormattedText(playerid, const str[], define);
forward public SendAllFormattedText(playerid, const str[], define);

//------------------------------------------------------------------------------------------------------

new CashScoreOld;
new iSpawnSet[MAX_PLAYERS];

new Float:gRandomPlayerSpawns[1][3] = {
{1958.3783,1343.1572,15.3746}
};

new Float:gCopPlayerSpawns[2][3] = {
{2297.1064,2452.0115,10.8203},
{2297.0452,2468.6743,10.8203}
};

//Round čas
//new gRoundTime = 3600000; // Round time - 1 hour
//new gRoundTime = 1200000; // Round time - 20 mins
//new gRoundTime = 900000; // Round time - 15 mins
//new gRoundTime = 600000; // Round time - 10 mins
//new gRoundTime = 300000; // Round time - 5 mins
//new gRoundTime = 120000; // Round time - 2 mins
//new gRoundTime = 60000; // Round time - 1 min

new gActivePlayers[MAX_PLAYERS];
new gLastGaveCash[MAX_PLAYERS];

//------------------------------------------------------------------------------------------------------

main()
{

print("\n----------------------------------");
print(" * Realny Svet 3.2 *\n");
print(" www.FlowGlass.crew.sk");
print(" CZ/SK");
print("----------------------------------\n");
}

//------------------------------------------------------------------------------------------------------

public OnPlayerRequestSpawn(playerid)
{
SendPlayerFormattedText(playerid, "[ Info ]: Pre pomoc napíš /help", 0);
//printf("OnPlayerRequestSpawn(%d)",playerid);
return 1;
}

//------------------------------------------------------------------------------------------------------

public OnPlayerPickUpPickup(playerid, pickupid)
{
//new s[256];
//format(s,256,"Picked up %d",pickupid);
//SendClientMessage(playerid,0xFFFFFFFF,s);
}

//------------------------------------------------------------------------------------------------------

public MoneyGrubScoreUpdate()
{
new CashScore;
new name[MAX_PLAYER_NAME];
//new string[256];
for(new i=0; i{
if (IsPlayerConnected(i))
{
GetPlayerName(i, name, sizeof(name));
CashScore = GetPlayerMoney(i);
SetPlayerScore(i, CashScore);
if (CashScore > CashScoreOld)
{
CashScoreOld = CashScore;
//format(string, sizeof(string), "$$$ %s is now in the lead $$$", name);
//SendClientMessageToAll(COLOR_YELLOW, string);
}
}
}
}

//------------------------------------------------------------------------------------------------------

/*public GrubModeReset()
{
for(new i=0; i{
if (IsPlayerConnected(i))
{
SetPlayerScore(i, PocketMoney);
SetPlayerRandomSpawn(i, classid);
}
}

}*/

//------------------------------------------------------------------------------------------------------

public OnPlayerConnect(playerid)
{

login[playerid] = false;

GameTextForPlayer(playerid,"Realny Svet 3.2",5000,5);
SendPlayerFormattedText(playerid, "Vitaj na Reálny Svet 3.2 !!!", 0);
SendPlayerFormattedText(playerid,"-----------------------------------------------------------------------", 0);
gActivePlayers[playerid]++;
gLastGaveCash[playerid] = GetTickCount();
return 1;
}

//------------------------------------------------------------------------------------------------------
public OnPlayerDisconnect(playerid, reason)
{

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

gActivePlayers[playerid]--;
}
//------------------------------------------------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{

dcmd(login, 5, cmdtext);
dcmd(register, 8, cmdtext);

new string[256];
new playermoney;
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new cmd[256];
new giveplayerid, moneys, idx;

cmd = strtok(cmdtext, idx);

if(strcmp(cmd, "/help", true) == 0) {
SendClientMessage(playerid, COLOR_GREEN, "Pomoc:");
SendClientMessage(playerid, COLOR_GREY, "* Príkazom /prikazy budú zobrazené príkazy na tohto servera.");
SendClientMessage(playerid, COLOR_GREY, "* Príkazom /givecash [iD Hráča] [sUMA] môžete posielať peniaze.");
SendClientMessage(playerid, COLOR_GREY, "* Príkazom /info získate informácie o tomto móde.");
SendClientMessage(playerid, COLOR_GREY, "-----------------------------------------------------------------------");
return 1;
}
if(strcmp(cmd, "/prikazy", true) == 0) {
SendClientMessage(playerid, COLOR_GREY, "/help /info /prikazy /admins");
SendClientMessage(playerid, COLOR_GREY, "-----------------------------------------------------------------------");
return 1;
}
if(strcmp(cmd, "/info", true) == 0) {
SendPlayerFormattedText(playerid,"* Reálny Svet - 3.2 *",0);
SendPlayerFormattedText(playerid,"Názov módu: Reálny Svet 3.2",0);
SendPlayerFormattedText(playerid,"Náš web: www.FlowGlass.crew.sk",0);
SendPlayerFormattedText(playerid,"Kontakt: [email protected]",0);
SendPlayerFormattedText(playerid,"Skype: Deathigos, teo85101", 0);
SendPlayerFormattedText(playerid,"-----------------------------------------------------------------------", 0);
return 1;
}

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

if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "Napíš: /givecash [iD Hráča] [sUMA]");
return 1;
}
giveplayerid = strval(tmp);

tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "Napíš: /givecash [iD Hráča] [sUMA]");
return 1;
}
moneys = strval(tmp);

//printf("givecash_command: %d %d",giveplayerid,moneys);


if (IsPlayerConnected(giveplayerid)) {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerMoney(playerid);
if (moneys > 0 && playermoney >= moneys) {
GivePlayerMoney(playerid, (0 - moneys));
GivePlayerMoney(giveplayerid, moneys);
format(string, sizeof(string), "Poslal si peniaze hráčovi %s(ID: %d), $%d.", giveplayer,giveplayerid, moneys);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "Dostal si $%d od %s(ID: %d).", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
printf("%s(playerid:%d) presunuté %d na %s(ID:%d)",sendername, playerid, moneys, giveplayer, giveplayerid);
}
else {
SendClientMessage(playerid, COLOR_YELLOW, "Neplatná suma.");
}
}
else {
format(string, sizeof(string), "%d nie je aktívny.", giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 1;
}

// PROCESS OTHER COMMANDS


return false;
}

//------------------------------------------------------------------------------------------------------

public OnPlayerSpawn(playerid)
{
GivePlayerMoney(playerid, PocketMoney);
SetPlayerInterior(playerid,0);
SetPlayerRandomSpawn(playerid);
TogglePlayerClock(playerid,1);
return 1;
}

public SetPlayerRandomSpawn(playerid)
{
if (iSpawnSet[playerid] == 1)
{
new rand = random(sizeof(gCopPlayerSpawns));
SetPlayerPos(playerid, gCopPlayerSpawns[rand][0], gCopPlayerSpawns[rand][1], gCopPlayerSpawns[rand][2]); // Warp
SetPlayerFacingAngle(playerid, 270.0);
}
else if (iSpawnSet[playerid] == 0)
{
new rand = random(sizeof(gRandomPlayerSpawns));
SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); // Warp
}
return 1;
}

//------------------------------------------------------------------------------------------------------

public OnPlayerDeath(playerid, killerid, reason)
{
SendClientMessage(playerid, COLOR_GREEN, "( ! ) Zomrel si ( ! )");
new playercash;
if(killerid == INVALID_PLAYER_ID) {
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
ResetPlayerMoney(playerid);
} else {
SendDeathMessage(killerid,playerid,reason);
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
playercash = GetPlayerMoney(playerid);
if (playercash > 0) {
GivePlayerMoney(killerid, playercash);
ResetPlayerMoney(playerid);
}
else
{
}
}
return 1;
}

/* public OnPlayerDeath(playerid, killerid, reason)
{ haxed by teh mike
new name[MAX_PLAYER_NAME];
new string[256];
new deathreason[20];
new playercash;
GetPlayerName(playerid, name, sizeof(name));
GetWeaponName(reason, deathreason, 20);
if (killerid == INVALID_PLAYER_ID) {
switch (reason) {
case WEAPON_DROWN:
{
format(string, sizeof(string), "*** %s drowned.)", name);
}
default:
{
if (strlen(deathreason) > 0) {
format(string, sizeof(string), "*** %s died. (%s)", name, deathreason);
} else {
format(string, sizeof(string), "*** %s died.", name);
}
}
}
}
else {
new killer[MAX_PLAYER_NAME];
GetPlayerName(killerid, killer, sizeof(killer));
if (strlen(deathreason) > 0) {
format(string, sizeof(string), "*** %s killed %s. (%s)", killer, name, deathreason);
} else {
format(string, sizeof(string), "*** %s killed %s.", killer, name);
}
}
SendClientMessageToAll(COLOR_RED, string);
{
playercash = GetPlayerMoney(playerid);
if (playercash > 0)
{
GivePlayerMoney(killerid, playercash);
ResetPlayerMoney(playerid);
}
else
{
}
}
return 1;
}*/

//------------------------------------------------------------------------------------------------------

public OnPlayerRequestClass(playerid, classid)
{
iSpawnSet[playerid] = 0;
SetupPlayerForClassSelection(playerid);
return 1;
}

public SetupPlayerForClassSelection(playerid)
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}

public GameModeExitFunc()
{
GameModeExit();
}

public OnGameModeInit()
{
SetGameModeText("Realny Svet 3.2");

ShowPlayerMarkers(1);
ShowNameTags(1);
EnableStuntBonusForAll(0);

// Player Class's
AddPlayerClass(0,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1);

// Car Spawns


SetTimer("MoneyGrubScoreUpdate", 1000, 1);
//SetTimer("GameModeExitFunc", gRoundTime, 0);

return 1;
}



public SendPlayerFormattedText(playerid, const str[], define)
{
new tmpbuf[256];
format(tmpbuf, sizeof(tmpbuf), str, define);
SendClientMessage(playerid, 0xFF004040, tmpbuf);
}

public SendAllFormattedText(playerid, const str[], define)
{
new tmpbuf[256];
format(tmpbuf, sizeof(tmpbuf), str, define);
SendClientMessageToAll(0xFFFF00AA, tmpbuf);
}

dcmd_register(playerid,params[])
{
if (login[playerid]) return SendClientMessage(playerid, SYSTEM,"[Life]Already authed.");
if (udb_Exists(PlayerName(playerid))) return SendClientMessage(playerid, SYSTEM,"[Life]Účet už existuje!!!!-Lamo-Přihlaš se příkazem:'/login password'.");
if (strlen(params)==0) return SendClientMessage(playerid, SYSTEM,"[Life]Použití: '/register password'");
if (udb_Create(PlayerName(playerid),params)) return SendClientMessage(playerid, SYSTEM,"[Life]Účet úspěšně vytvořený přihlaš se:'/login password'.");
return 1;
}


dcmd_login(playerid,params[])
{
if (login[playerid]) return SendClientMessage(playerid, SYSTEM,"[Life]Already authed.");
if (!udb_Exists(PlayerName(playerid))) return SendClientMessage(playerid, SYSTEM,"[Life]Účet Neexistuje zaregistruj se příkazem: '/register password'.");
if (strlen(params)==0) return SendClientMessage(playerid, SYSTEM,"[Life]Použití: '/login password'");
if (udb_CheckLogin(PlayerName(playerid),params))
{
GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid));
login[playerid]=true;
return SendClientMessage(playerid, SYSTEM,"[Life]Successfully authed!");
}
return SendClientMessage(playerid, SYSTEM,"[Life]Přihlášení neuspěšné!");
}

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

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