Tessék:
(a bountyt átírhatod)
100% hogy jó.
Parancsok:
/bounty <id> [összeg] = vérdíjat kituz
/bountyes = folyamatban lévo vérdíjak
new bounty[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new cmd[256];
new giveplayerid, moneys, idx;
new tmp[256];
// Bounty
if(strcmp(cmd,\"/bounty\",true) == 0) {
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) {
SendClientMessage(playerid,COLOR_RED,\"HASZNÁLAT: /bounty <ID> <ÖSSZEG>\");
return 1;
}
giveplayerid = strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) {
SendClientMessage(playerid,COLOR_RED,\"HASZNÁLAT: /bounty <ID> <ÖSSZEG>\");
return 1;
}
moneys = strval(tmp);
if(moneys > GetPlayerMoney(playerid)) {
SendClientMessage(playerid, COLOR_RED,\"Nincs elég pénzed!\");
return 1;
}
if(moneys < 1) {
SendClientMessage(playerid, COLOR_RED,\"Mit próbálkozól?\");
return 1;
}
if(IsPlayerConnected(giveplayerid) == 0) {
SendClientMessage(playerid, COLOR_RED,\"Nem aktív játékos!\");
return 1;
}
bounty[giveplayerid]+=moneys;
GivePlayerMoney(playerid, 0-moneys);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string),\"%s $%d vérdíjat tuzött ki %s fejére! (Összesen: $%d)\",sendername,moneys,giveplayer,bounty[giveplayerid]);
SendClientMessageToAll(COLOR_GREEN, string);
return 1;
}
// Bounties
if(strcmp(cmd,\"/bounties\",true) == 0) {
new x;
SendClientMessage(playerid, COLOR_YELLOW,\"Folyamatban lévo vérdíjak:\");
for(new i=0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i) && bounty > 0) {
GetPlayerName(i, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), \"%s%s: $%d\", string,giveplayer,bounty);
x++;
if(x > 3) {
SendClientMessage(playerid, COLOR_GREEN, string);
x = 0;
format(string, sizeof(string), \"\");
} else {
format(string, sizeof(string), \"%s, \", string);
}
}
}
if(x <= 3 && x > 0) {
string[strlen(string)-2] = \' \';
SendClientMessage(playerid, COLOR_GREEN, string);
}
return 1;
}
// PROCESS OTHER COMMANDS
return 0;
}
Tessék:
(a bountyt átírhatod)
100% hogy jó.
Parancsok:
/bounty <id> [összeg] = vérdíjat kituz
/bountyes = folyamatban lévo vérdíjak
new bounty[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new cmd[256];
new giveplayerid, moneys, idx;
new tmp[256];
// Bounty
if(strcmp(cmd,\"/bounty\",true) == 0) {
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) {
SendClientMessage(playerid,COLOR_RED,\"HASZNÁLAT: /bounty <ID> <ÖSSZEG>\");
return 1;
}
giveplayerid = strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) {
SendClientMessage(playerid,COLOR_RED,\"HASZNÁLAT: /bounty <ID> <ÖSSZEG>\");
return 1;
}
moneys = strval(tmp);
if(moneys > GetPlayerMoney(playerid)) {
SendClientMessage(playerid, COLOR_RED,\"Nincs elég pénzed!\");
return 1;
}
if(moneys < 1) {
SendClientMessage(playerid, COLOR_RED,\"Mit próbálkozól?\");
return 1;
}
if(IsPlayerConnected(giveplayerid) == 0) {
SendClientMessage(playerid, COLOR_RED,\"Nem aktív játékos!\");
return 1;
}
bounty[giveplayerid]+=moneys;
GivePlayerMoney(playerid, 0-moneys);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string),\"%s $%d vérdíjat tuzött ki %s fejére! (Összesen: $%d)\",sendername,moneys,giveplayer,bounty[giveplayerid]);
SendClientMessageToAll(COLOR_GREEN, string);
return 1;
}
// Bounties
if(strcmp(cmd,\"/bounties\",true) == 0) {
new x;
SendClientMessage(playerid, COLOR_YELLOW,\"Folyamatban lévo vérdíjak:\");
for(new i=0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i) && bounty > 0) {
GetPlayerName(i, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), \"%s%s: $%d\", string,giveplayer,bounty);
x++;
if(x > 3) {
SendClientMessage(playerid, COLOR_GREEN, string);
x = 0;
format(string, sizeof(string), \"\");
} else {
format(string, sizeof(string), \"%s, \", string);
}
}
}
if(x <= 3 && x > 0) {
string[strlen(string)-2] = \' \';
SendClientMessage(playerid, COLOR_GREEN, string);
}
return 1;
}
// PROCESS OTHER COMMANDS
return 0;
}
Most vagy én vok a hülye vagy te nem vagy barátságban a ReturnUser-el xD
okok
kössz
Megpróbáltam, lehet 100%osan jó, csak nem nekem :S
C:\\lv\\filterscripts\\hitman.pwn(9) : error 017: undefined symbol \"MAX_PLAYERS\"
C:\\lv\\filterscripts\\hitman.pwn(1) : error 009: invalid array size (negative, zero or out of bounds)
C:\\lv\\filterscripts\\hitman.pwn(3) : warning 235: public function lacks forward declaration (symbol \"OnPlayerCommandText\")
C:\\lv\\filterscripts\\hitman.pwn(6) : error 017: undefined symbol \"MAX_PLAYER_NAME\"
C:\\lv\\filterscripts\\hitman.pwn(6) : error 009: invalid array size (negative, zero or out of bounds)
C:\\lv\\filterscripts\\hitman.pwn(6) : error 036: empty statement
C:\\lv\\filterscripts\\hitman.pwn(6) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
6 Errors.