PDA

Просмотр полной версии : [Вопрос] error 059



heralt
28.01.2015, 20:11
Выбивают ошибку, по уроку на форуме (http://pro-pawn.ru/showthread.php?5560-sscanf-OnPlayerCommandText).



C:\Users\Áàòÿ âñåÿ Ðóñè\Desktop\Ïðîåêò\gamemodes\Heinz-v2.pwn(159) : error 059: function argument may not have a default value (variable "calledbytimer")
C:\Users\Áàòÿ âñåÿ Ðóñè\Desktop\Ïðîåêò\gamemodes\Heinz-v2.pwn(3312) : error 059: function argument may not have a default value (variable "calledbytimer")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.

heralt
28.01.2015, 21:07
Все, решил. Теперь вопрос встал, как сделать чтобы он отображался только тем, кто состоит в организации (Полиция)?

bredvix
28.01.2015, 21:10
Код в студию и ид фракции Полиция

heralt
28.01.2015, 21:17
if(strcmp(cmdtext,"/backup",true)==0 || strcmp(cmdtext,"/bk",true)==0)
{
if (PlayerInfo[playerid][pGroup] == 2) return SendClientMessage(playerid, red, "Âû íå êîï!");
if (PlayerInfo[playerid][pRequestingBackup]) return SendClientMessage(playerid, red, "Âû óæå âûçûâàåòå ïîäìîãó!");
static const fmt_str[]="[Âíèìàíèå]: %s íóæäàåòñÿ â ïîäìîãå, îí îòìå÷åí êðàñíûì ìàðêåðîì íà ðàäàðå.";
new string[sizeof(fmt_str)-2+MAX_PLAYER_NAME];
GetPlayerName(playerid, string, sizeof(string));
format(string, sizeof(string), fmt_str, string);
PlayerInfo[playerid][pRequestingBackup] = 1;
new i = GetMaxPlayers();
do{
if(IsPlayerConnected(--i))
{
if (PlayerInfo[playerid][pGroup] == 3)
{
SetPlayerMarkerForPlayer(i, playerid, 0xFF0000FF);
SendClientMessage(i, 0x8D8DFF00, string);
}
}
}while(i != 0);
SetTimerEx("BackupClear", 3*1000, false, "ii", playerid, 1);
return SendClientMessage(playerid, 0x8D8DFF00, "Èñïîëüçóéòå /bkc, ÷òîáû îòìåíèòü âûçîâ ïîäìîãè.");
}
if(strcmp(cmdtext,"/backupclear",true)==0 || strcmp(cmdtext,"/bkc",true)==0)
{
SendClientMessage(playerid, red, "Âàø çàïðîñ î ïîäìîãå áûë îòìåíåí.");
PlayerInfo[playerid][pRequestingBackup] = 0;
}

Ид полиции - 2.

bredvix
28.01.2015, 22:05
if(strcmp(cmdtext,"/backup",true)==0 || strcmp(cmdtext,"/bk",true)==0)
{
if (PlayerInfo[playerid][pGroup] == 2) return SendClientMessage(playerid, red, "Âû íå êîï!");
if (PlayerInfo[playerid][pRequestingBackup]) return SendClientMessage(playerid, red, "Âû óæå âûçûâàåòå ïîäìîãó!");
static const fmt_str[]="[Âíèìàíèå]: %s íóæäàåòñÿ â ïîäìîãå, îí îòìå÷åí êðàñíûì ìàðêåðîì íà ðàäàðå.";
new string[sizeof(fmt_str)-2+MAX_PLAYER_NAME];
GetPlayerName(playerid, string, sizeof(string));
format(string, sizeof(string), fmt_str, string);
PlayerInfo[playerid][pRequestingBackup] = 1;
new i = GetMaxPlayers();
do{
if(IsPlayerConnected(--i))
{
if (PlayerInfo[playerid][pGroup] == 3)
{
SetPlayerMarkerForPlayer(i, playerid, 0xFF0000FF);
SendClientMessage(i, 0x8D8DFF00, string);
}
}
}while(i != 0);
SetTimerEx("BackupClear", 3*1000, false, "ii", playerid, 1);
return SendClientMessage(playerid, 0x8D8DFF00, "Èñïîëüçóéòå /bkc, ÷òîáû îòìåíèòü âûçîâ ïîäìîãè.");
}
if(strcmp(cmdtext,"/backupclear",true)==0 || strcmp(cmdtext,"/bkc",true)==0)
{
SendClientMessage(playerid, red, "Âàø çàïðîñ î ïîäìîãå áûë îòìåíåí.");
PlayerInfo[playerid][pRequestingBackup] = 0;
}

Ид полиции - 2.

расскладку измени, а то твои крякозябры не найс читать.

heralt
28.01.2015, 23:37
if(strcmp(cmdtext,"/backup",true)==0 || strcmp(cmdtext,"/bk",true)==0)
{
if (PlayerInfo[playerid][pGroup] != 2) return SendClientMessage(playerid, red, "Вы не сотрудник Полиции!");
if (PlayerInfo[playerid][pRequestingBackup]) return SendClientMessage(playerid, red, "Вы уже вызываете подмогу!");
static const fmt_str[]="[Внимание]: %s нуждается в подмоге, он отмечен красным маркером на радаре.";
new string[sizeof(fmt_str)-2+MAX_PLAYER_NAME];
GetPlayerName(playerid, string, sizeof(string));
format(string, sizeof(string), fmt_str, string);
PlayerInfo[playerid][pRequestingBackup] = 1;
new i = GetMaxPlayers();
do{
if(IsPlayerConnected(--i))
{
if (PlayerInfo[playerid][pGroup] == 3)
{
SetPlayerMarkerForPlayer(i, playerid, 0xFF0000FF);
SendClientMessage(i, 0x8D8DFF00, string);
}
}
}while(i != 0);
SetTimerEx("BackupClear", 3*1000, false, "ii", playerid, 1);
return SendClientMessage(playerid, 0x8D8DFF00, "Используйте /bkc, чтобы отменить вызов подмоги.");
}
if(strcmp(cmdtext,"/backupclear",true)==0 || strcmp(cmdtext,"/bkc",true)==0)
{
SendClientMessage(playerid, red, "Ваш запрос о подмоге был отменен.");
PlayerInfo[playerid][pRequestingBackup] = 0;
}

bredvix
29.01.2015, 00:11
if(strcmp(cmdtext,"/backup",true)==0 || strcmp(cmdtext,"/bk",true)==0)
{
if (PlayerInfo[playerid][pGroup] != 2) return SendClientMessage(playerid, red, "Вы не сотрудник Полиции!");
if (PlayerInfo[playerid][pRequestingBackup]) return SendClientMessage(playerid, red, "Вы уже вызываете подмогу!");
//
if (PlayerInfo[playerid][pGroup] == 2)
{
static const fmt_str[]="[Внимание]: %s нуждается в подмоге, он отмечен красным маркером на радаре.";
new string[sizeof(fmt_str)-2+MAX_PLAYER_NAME];
GetPlayerName(playerid, string, sizeof(string));
format(string, sizeof(string), fmt_str, string);
}
//
PlayerInfo[playerid][pRequestingBackup] = 1;
new i = GetMaxPlayers();
do
{
if(IsPlayerConnected(--i))
{
if (PlayerInfo[playerid][pGroup] == 3)
{
SetPlayerMarkerForPlayer(i, playerid, 0xFF0000FF);
SendClientMessage(i, 0x8D8DFF00, string);
}
}
}
while(i != 0);
SetTimerEx("BackupClear", 3*1000, false, "ii", playerid, 1);
return SendClientMessage(playerid, 0x8D8DFF00, "Используйте /bkc, чтобы отменить вызов подмоги.");
}
if(strcmp(cmdtext,"/backupclear",true)==0 || strcmp(cmdtext,"/bkc",true)==0)
{
SendClientMessage(playerid, red, "Ваш запрос о подмоге был отменен.");
PlayerInfo[playerid][pRequestingBackup] = 0;
}

heralt
29.01.2015, 00:27
щас посмотрим

- - - Добавлено - - -

Короче, сделал команду мегафон, ошибка появилась одна:

Код команды


if(strcmp(cmdtext, "/mg", true) == 0 || strcmp(cmdtext, "/m", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new idx, string[128];
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, yellow, "ИНФО: (/mg) [megaphone chat]");
return 1;
}
//GetInitials(playerid);
format(string, sizeof(string),"Офицер %s: %s", sendername, result);
ProxDetector(100.0, playerid, string,COLOR_TOMATO,COLOR_TOMATO,COLOR_TOMATO,COLOR_TOMATO,COLOR_TOMATO);
}
return 1;
}


C:\Users\----------\Desktop\Проект\gamemodes\Heinz-v2.pwn(1128) : error 017: undefined symbol "ProxDetector"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.

- - - Добавлено - - -

Помогите пожалуйста, я только-только начинаю разбираться в павно.

Alexander
29.01.2015, 00:34
попоробуй это сунуть в конец мода

stock ProxDetector(Float:radi, playerid, str[],col1,col2,col3,col4,col5)
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
foreach(new i:Player)
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16))) SendClientMessage(i, col1, str);
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) SendClientMessage(i, col2, str);
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) SendClientMessage(i, col3, str);
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) SendClientMessage(i, col4, str);
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) SendClientMessage(i, col5, str);
}
return true;
}

heralt
29.01.2015, 00:53
попоробуй это сунуть в конец мода

stock ProxDetector(Float:radi, playerid, str[],col1,col2,col3,col4,col5)
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
foreach(new i:Player)
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16))) SendClientMessage(i, col1, str);
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) SendClientMessage(i, col2, str);
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) SendClientMessage(i, col3, str);
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) SendClientMessage(i, col4, str);
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) SendClientMessage(i, col5, str);
}
return true;
}


C:\Users\Áàòÿ âñåÿ Ðóñè\Desktop\Ïðîåêò\Pawno\include\sscanf.inc(173) : error 017: undefined symbol "foreach"
C:\Users\Áàòÿ âñåÿ Ðóñè\Desktop\Ïðîåêò\Pawno\include\sscanf.inc(175) : error 017: undefined symbol "playerid"
C:\Users\Áàòÿ âñåÿ Ðóñè\Desktop\Ïðîåêò\Pawno\include\sscanf.inc(178) : error 017: undefined symbol "playerid"
C:\Users\Áàòÿ âñåÿ Ðóñè\Desktop\Ïðîåêò\gamemodes\Heinz-v2.pwn(3418) : error 075: input line too long (after substitutions)
C:\Users\Áàòÿ âñåÿ Ðóñè\Desktop\Ïðîåêò\gamemodes\Heinz-v2.pwn(3426) : error 017: undefined symbol "foreach"
C:\Users\Áàòÿ âñåÿ Ðóñè\Desktop\Ïðîåêò\gamemodes\Heinz-v2.pwn(3426) : error 029: invalid expression, assumed zero
C:\Users\Áàòÿ âñåÿ Ðóñè\Desktop\Ïðîåêò\gamemodes\Heinz-v2.pwn(3426) : error 017: undefined symbol "Player"
C:\Users\Áàòÿ âñåÿ Ðóñè\Desktop\Ïðîåêò\gamemodes\Heinz-v2.pwn(3426) : fatal error 107: too many error messages on one line

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


8 Errors.


- - - Добавлено - - -

Есть у кого инклуд foreach? Нигде найти не могу :c

Alexander
29.01.2015, 00:59
https://yadi.sk/d/PLWFKtyCeJj5M foreach

https://yadi.sk/d/0ikic7tueJj5R sscanf2 если с твоим не потянет


будут еще вопросы пиши в скайп всегда буду рад памоч начинающему
samp7-7-7