našel jsem question plugin na sa-mp fóru v angličtině, tak jsem si ho upravil do češtiny a upravil jsem taky příkaz /answer na adminlevel místo rcon. Ale poté co jsem ho chtěl compilovat tak mi vyskočili tyto errory.
C:\Users\Sparthly\Desktop\question.pwn(60) : error 017: undefined symbol "Player"
C:\Users\Sparthly\Desktop\question.pwn(60) : warning 215: expression has no effect
C:\Users\Sparthly\Desktop\question.pwn(60) : error 001: expected token: ";", but found "]"
C:\Users\Sparthly\Desktop\question.pwn(60) : error 029: invalid expression, assumed zero
C:\Users\Sparthly\Desktop\question.pwn(60) : fatal error 107: too many error messages on one line
Dotaz
SpaRthly 0
Zdravím,
našel jsem question plugin na sa-mp fóru v angličtině, tak jsem si ho upravil do češtiny a upravil jsem taky příkaz /answer na adminlevel místo rcon. Ale poté co jsem ho chtěl compilovat tak mi vyskočili tyto errory.
C:\Users\Sparthly\Desktop\question.pwn(60) : error 017: undefined symbol "Player"
C:\Users\Sparthly\Desktop\question.pwn(60) : warning 215: expression has no effect
C:\Users\Sparthly\Desktop\question.pwn(60) : error 001: expected token: ";", but found "]"
C:\Users\Sparthly\Desktop\question.pwn(60) : error 029: invalid expression, assumed zero
C:\Users\Sparthly\Desktop\question.pwn(60) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Kód
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_PURPLE 0x9900FFAA
#define COLOR_BROWN 0x993300AA
#define COLOR_ORANGE 0xFF9933AA
#define COLOR_BLACK 0x000000AA
#define COLOR_BLUE 0x00BFFFAA
#define COLOR_RED 0xFF0000AA
new Question[MAX_PLAYERS][256];
new bool:QuestionAsked[MAX_PLAYERS];
public OnPlayerDisconnect(playerid, reason)
{
QuestionAsked[playerid] = false;
format(Question[playerid], 256, " ");
return 1;
}
public OnPlayerCommandReceived(playerid, cmdtext[])
{
return 1;
}
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success)
{
new string[128];
format(string, sizeof(string), "{FF0000}[!] {FFFFFF}Tento příkaz '%s' neexistuje!", cmdtext);
return SendClientMessage(playerid, COLOR_RED, string);
}
return 1;
}
COMMAND:dotaz(playerid, params[])
{
if (sscanf(params, "s[256]", Question[playerid])) return SendClientMessage(playerid, COLOR_RED, "{FF0000}[!] {FFFFFF}Použij: /dotaz [Text]");
if(QuestionAsked[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "{FF0000}[!] {FFFFFF}Počkej než administrátor odpoví na tvůj předchozí dotaz!");
new string[128], string2[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string2, sizeof(string2), "QUESTION: %s", Question[playerid]);
SendClientMessageToAdmins(COLOR_GREEN, string2);
format(string, sizeof(string), "{FF0000}[!] {FFFFFF} %s má dotaz, použij /odpoved %d pro zodpovězení dotazů!", name, playerid);
SendClientMessageToAdmins(COLOR_GREEN, string);
QuestionAsked[playerid] = true;
return 1;
}
COMMAND:odpoved(playerid, params[])
{
new ID, string[256], string2[256];
if(Player[playerid][AdminLevel]==1) return SendClientMessage(playerid, COLOR_RED, "{FF0000}[!] {FFFFFF}Nemáš administratorské práva!");
if (sscanf(params, "is[256]", ID, string)) return SendClientMessage(playerid, COLOR_RED, "{FF0000}[!] {FFFFFF}/odpoved [ID] [Text]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "{FF0000}[!] {FFFFFF} Tento hráč není na serveru!");
if(QuestionAsked[ID] != true) return SendClientMessage(playerid, COLOR_RED, "{FF0000}[!] {FFFFFF} Tento hráč nemá žádný dotaz!");
QuestionAsked[ID] = false;
format(string2, sizeof(string2), "ANSWER: %s", string);
SendClientMessage(ID, COLOR_GREEN, string2);
return 1;
}
COMMAND:sdotaz(playerid, params[])
{
new ID;
if(Player[playerid][AdminLevel]==1) return SendClientMessage(playerid, COLOR_RED, "{FF0000}[!] {FFFFFF}Nemáš administratorské práva!");
if (sscanf(params, "i", ID)) return SendClientMessage(playerid, COLOR_RED, "{FF0000}[!] {FFFFFF} /sdotaz [ID]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "{FF0000}[!] {FFFFFF} Tento hráč není na serveru!");
if(QuestionAsked[ID] != true) return SendClientMessage(playerid, COLOR_RED, "{FF0000}[!] {FFFFFF} Tento hráč nemá žádný dotaz!");
QuestionAsked[ID] = false;
SendClientMessage(ID, COLOR_GREEN, "{FF0000}[!] {FFFFFF} Váš dotaz byl smazán!");
return 1;
}
SendClientMessageToAdmins(color, string[])
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerAdmin(i))
{
SendClientMessage(i, color, string);
}
}
}
}
Link to comment
Share on other sites
9 odpovědí na tuto otázku
Recommended Posts