4 errors 1 line -
Pro_Scriptor - 23.07.2012
pawn Код:
dcmd_admins(playerid, cmdtext[]) {
new strtext[1000];
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GREEN, ".::Admins OnLine::.");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[playerid][ pAdmin ] >= 1)
{
line 1754= GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Junior Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x99CCCCAA, string)
}
if(PlayerInfo[playerid][ pAdmin ] >= 2)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[General Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x99FFCCAA, string);
}
if(PlayerInfo[playerid][ pAdmin ] >= 3)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Senior Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x99FFCCAA, string);
}
if(PlayerInfo[playerid][ pAdmin ] >= 4)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Head Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x008D04FF, string);
}
if(PlayerInfo[playerid][ pAdmin ] >= 5)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[[Server Manager] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x006CA2FF, string);
}
if(PlayerInfo[i][pAdmin] == 6)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Co-Executive Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x006CA2FF, string);
}
if(PlayerInfo[playerid][ pAdmin ] >= 7)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Executive Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x794040FF, string);
}
strcat(string, "\n");
strcat(strtext, string);
}
}
ShowPlayerDialog(playerid, 0xF, DIALOG_STYLE_MSGBOX,"~ Admins ~", strtext, "Ok",#);
}
return 1;
}
Код:
D:\Drivers\unused\XTREME~1\GAMEMO~1\LSTWSE.pwn(1754) : error 017: undefined symbol "playern"
D:\Drivers\unused\XTREME~1\GAMEMO~1\LSTWSE.pwn(1754) : error 017: undefined symbol "playern"
D:\Drivers\unused\XTREME~1\GAMEMO~1\LSTWSE.pwn(1754) : error 029: invalid expression, assumed zero
D:\Drivers\unused\XTREME~1\GAMEMO~1\LSTWSE.pwn(1754) : fatal error 107: too many error messages on one line
line 1754=
Re: 4 errors 1 line -
Kindred - 23.07.2012
Who made this for you? Because you obviously do not have an IQ to know how to fix this, or how to make a command.
pawn Код:
dcmd_admins(playerid, cmdtext[]) {
new strtext[1000], playern[24];
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GREEN, ".::Admins OnLine::.");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[playerid][ pAdmin ] >= 1)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Junior Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x99CCCCAA, string)
}
if(PlayerInfo[playerid][ pAdmin ] >= 2)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[General Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x99FFCCAA, string);
}
if(PlayerInfo[playerid][ pAdmin ] >= 3)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Senior Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x99FFCCAA, string);
}
if(PlayerInfo[playerid][ pAdmin ] >= 4)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Head Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x008D04FF, string);
}
if(PlayerInfo[playerid][ pAdmin ] >= 5)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[[Server Manager] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x006CA2FF, string);
}
if(PlayerInfo[i][pAdmin] == 6)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Co-Executive Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x006CA2FF, string);
}
if(PlayerInfo[playerid][ pAdmin ] >= 7)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Executive Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x794040FF, string);
}
strcat(string, "\n");
strcat(strtext, string);
}
}
ShowPlayerDialog(playerid, 0xF, DIALOG_STYLE_MSGBOX,"~ Admins ~", strtext, "Ok",#);
}
return 1;
}
Re: 4 errors 1 line -
Pro_Scriptor - 23.07.2012
D:\Drivers\unused\XTREME~1\GAMEMO~1\LSTWSE.pwn(175 5) : error 017: undefined symbol "string"
D:\Drivers\unused\XTREME~1\GAMEMO~1\LSTWSE.pwn(176 1) : error 017: undefined symbol "string"
D:\Drivers\unused\XTREME~1\GAMEMO~1\LSTWSE.pwn(176 7) : error 017: undefined symbol "string"
D:\Drivers\unused\XTREME~1\GAMEMO~1\LSTWSE.pwn(177 3) : error 017: undefined symbol "string"
D:\Drivers\unused\XTREME~1\GAMEMO~1\LSTWSE.pwn(177 9) : error 017: undefined symbol "string"
D:\Drivers\unused\XTREME~1\GAMEMO~1\LSTWSE.pwn(178 5) : error 017: undefined symbol "string"
D:\Drivers\unused\XTREME~1\GAMEMO~1\LSTWSE.pwn(179 1) : error 017: undefined symbol "string"
D:\Drivers\unused\XTREME~1\GAMEMO~1\LSTWSE.pwn(179 4) : error 017: undefined symbol "string"
D:\Drivers\unused\XTREME~1\GAMEMO~1\LSTWSE.pwn(179 5) : error 017: undefined symbol "string"
D:\Drivers\unused\XTREME~1\GAMEMO~1\LSTWSE.pwn(174 3) : warning 203: symbol is never used: "cmdtext"
line 1743 = dcmd_admins(playerid, cmdtext[]) {
Re: 4 errors 1 line -
XStormiest - 23.07.2012
pawn Код:
dcmd_admins(playerid, params[])
{
new strtext[1000],playern[MAX_PLAYER_NAME],string[129];
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GREEN, ".::Admins OnLine::.");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][ pAdmin ] >= 1)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Junior Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x99CCCCAA, string)
}
if(PlayerInfo[i][ pAdmin ] >= 2)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[General Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x99FFCCAA, string);
}
if(PlayerInfo[i[ pAdmin ] >= 3)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Senior Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x99FFCCAA, string);
}
if(PlayerInfo[i][ pAdmin ] >= 4)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Head Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x008D04FF, string);
}
if(PlayerInfo[i][ pAdmin ] >= 5)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[[Server Manager] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x006CA2FF, string);
}
if(PlayerInfo[i][pAdmin] == 6)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Co-Executive Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x006CA2FF, string);
}
if(PlayerInfo[i][ pAdmin ] >= 7)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Executive Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x794040FF, string);
}
strcat(string, "\n");
strcat(strtext, string);
}
}
ShowPlayerDialog(playerid, 0xF, DIALOG_STYLE_MSGBOX,"~ Admins ~", strtext, "Ok",#);
}
return 1;
}
Your scripter don't know scripting
1. he using a string without create it lol.....
2. write GetPlayerName ..in each if(PlayerInfo[i][pAdmin] == ..)
3. used players(player id) instead of i ( all players) in for(new i = 0;i < MAX_PLAYERS;i++) , and this is bad because this function loop functions for all players
Re: 4 errors 1 line -
Pro_Scriptor - 23.07.2012
D:\Drivers\unused\XTREME~1\GAMEMO~1\LSTWSE.pwn(174 4) : warning 203: symbol is never used: "params"
line 1743 = dcmd_admins(playerid, params[])
Re: 4 errors 1 line -
Revo - 23.07.2012
Please stop scripting immediately.
pawn Код:
dcmd_admins(playerid, cmdtext[]) {
new strtext[1000], string[75], playern[MAX_PLAYER_NAME];
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GREEN, ".::Admins OnLine::.");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if (PlayerInfo[i][pAdmin] > 0 && PlayerInfo[i][pAdmin] < 8)
{
GetPlayerName(i, playern, sizeof(playern));
switch(PlayerInfo[i][pAdmin])
{
case 1: format(string, sizeof(string), "[Junior Admin] %s [ID:%d]", playern, i);
case 2: format(string, sizeof(string), "[General Admin] %s [ID:%d]", playern, i);
case 3: format(string, sizeof(string), "[Senior Admin] %s [ID:%d]", playern, i);
case 4: format(string, sizeof(string), "[Head Admin] %s [ID:%d]", playern, i);
case 5: format(string, sizeof(string), "[Server Manager] %s [ID:%d]", playern, i);
case 6: format(string, sizeof(string), "[Co-Executive Admin] %s [ID:%d]", playern, i);
case 7: format(string, sizeof(string), "[Executive Admin] %s [ID:%d]", playern, i);
}
strcat(string, "\n");
strcat(strtext, string);
}
}
}
ShowPlayerDialog(playerid, 0xF, DIALOG_STYLE_MSGBOX,"~ Admins ~", strtext, "Ok", "");
}
#pragma unused params
return 1;
}
Heeeyooo
Re: 4 errors 1 line -
XStormiest - 23.07.2012
because it don't know dcmd function...
add this at the top of the script
pawn Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
and under
OnPlayerCommanText(playerid,params[])
{
dcmd(admins,5,cmdtext);
return 1;
}
if he will use your codew ( will give errors)..but fine...
and add this out of a callback
pawn Код:
dcmd_admins(playerid, params[])
{
new strtext[1000],playern[MAX_PLAYER_NAME],string[129];
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GREEN, ".::Admins OnLine::.");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][ pAdmin ] >= 1)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Junior Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x99CCCCAA, string)
}
if(PlayerInfo[i][ pAdmin ] >= 2)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[General Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x99FFCCAA, string);
}
if(PlayerInfo[i[ pAdmin ] >= 3)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Senior Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x99FFCCAA, string);
}
if(PlayerInfo[i][ pAdmin ] >= 4)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Head Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x008D04FF, string);
}
if(PlayerInfo[i][ pAdmin ] >= 5)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[[Server Manager] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x006CA2FF, string);
}
if(PlayerInfo[i][pAdmin] == 6)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Co-Executive Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x006CA2FF, string);
}
if(PlayerInfo[i][ pAdmin ] >= 7)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Executive Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x794040FF, string);
}
strcat(string, "\n");
strcat(strtext, string);
}
}
ShowPlayerDialog(playerid, 0xF, DIALOG_STYLE_MSGBOX,"~ Admins ~", strtext, "Ok",#);
}
return 1;
}
but not above of OnPlayerCommandText
like this
pawn Код:
#include <a_samp>
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
public OnPlayerCommandText(playerid,cmdtext[])
{
//your code...
dcmd(admins,5,cmdtext);
return 1;
}
dcmd_admins(playerid, params[])
{
new strtext[1000],playern[MAX_PLAYER_NAME],string[129];
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GREEN, ".::Admins OnLine::.");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][ pAdmin ] >= 1)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Junior Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x99CCCCAA, string)
}
if(PlayerInfo[i][ pAdmin ] >= 2)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[General Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x99FFCCAA, string);
}
if(PlayerInfo[i[ pAdmin ] >= 3)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Senior Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x99FFCCAA, string);
}
if(PlayerInfo[i][ pAdmin ] >= 4)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Head Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x008D04FF, string);
}
if(PlayerInfo[i][ pAdmin ] >= 5)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[[Server Manager] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x006CA2FF, string);
}
if(PlayerInfo[i][pAdmin] == 6)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Co-Executive Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x006CA2FF, string);
}
if(PlayerInfo[i][ pAdmin ] >= 7)
{
GetPlayerName(i, playern, sizeof(playern));
format(string, 128, "*[Executive Admin] %s [ID: %d]", playern, i);//, i, PlayerInfo[i][pAdmin]
//SendClientMessage(playerid, 0x794040FF, string);
}
strcat(string, "\n");
strcat(strtext, string);
}
}
ShowPlayerDialog(playerid, 0xF, DIALOG_STYLE_MSGBOX,"~ Admins ~", strtext, "Ok",#);
}
return 1;
}
in this case will give errors for me ( script) because don't know the PlayerInfo[i][pAdmin] function but for you will not give errors if try this..
Re: 4 errors 1 line -
Pro_Scriptor - 23.07.2012
did it by my self actually i am not familiar to dcmd so i did it by strcmp
Re: 4 errors 1 line -
XStormiest - 23.07.2012
I suggest you to learn zcmd is more easy to make a command..
Re: 4 errors 1 line -
Pro_Scriptor - 23.07.2012
ok i will