[NEW]ZCMD Admin Error - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [NEW]ZCMD Admin Error (
/showthread.php?tid=471990)
[NEW]ZCMD Admin Error -
donhu789 - 26.10.2013
PHP код:
C:\Documents and Settings\PhongLan\Desktop\New Folder (8)\gamemodes\SATDM_v14.pwn(20786) : error 022: must be lvalue (non-constant)
C:\Documents and Settings\PhongLan\Desktop\New Folder (8)\gamemodes\SATDM_v14.pwn(20786) : error 036: empty statement
C:\Documents and Settings\PhongLan\Desktop\New Folder (8)\gamemodes\SATDM_v14.pwn(20787) : error 014: invalid statement; not in switch
C:\Documents and Settings\PhongLan\Desktop\New Folder (8)\gamemodes\SATDM_v14.pwn(20787) : warning 215: expression has no effect
C:\Documents and Settings\PhongLan\Desktop\New Folder (8)\gamemodes\SATDM_v14.pwn(20787) : error 001: expected token: ";", but found ":"
C:\Documents and Settings\PhongLan\Desktop\New Folder (8)\gamemodes\SATDM_v14.pwn(20787) : error 029: invalid expression, assumed zero
C:\Documents and Settings\PhongLan\Desktop\New Folder (8)\gamemodes\SATDM_v14.pwn(20787) : fatal error 107: too many error messages on one line
pawn Код:
CMD:vadmins(playerid,params[])
{
#pragma unused params
new count = 0;
new string[128];
new ChangeColor;
SendClientMessage(playerid, green, " ");
SendClientMessage(playerid, green, "___________ |- Online Admins -| ___________");
SendClientMessage(playerid, green, " ");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(PlayerInfo[i][Level] >= 1 && PlayerInfo[i][Hide] == 0)
{
if(PlayerInfo[i][Level] > 5)
{
AdmRank = "Professional Admin";
}
if(IsPlayerAdmin(i))
{
AdmRank = "RCON Administrator";
}
else
{
switch(PlayerInfo[i][Level])
{
case 1: {
AdmRank = "Basic Moderator";
}
case 2: {
AdmRank = "Moderator";
}
case 3: {
AdmRank = "Master Moderator";
}
case 4: {
AdmRank = "Administrator";
}
case 5: {
AdmRank = "Master Administrator";
}
}
}
switch(PlayerInfo[i][OnDuty])
{
case 0: AdmDuty = "Playing!";
case 1: AdmDuty = "On Duty!";
}
format(string, 128, "Level: %d - %s (Id:%i) | %s | %s",PlayerInfo[i][Level], PlayerName2(i),i,AdmRank,AdmDuty);
SendClientMessage(playerid, green, string);
count++;
}
}
}
if (count == 0)
SendClientMessage(playerid,red,"No admin online in the list");
SendClientMessage(playerid, green, " _______________________________________");
return 1;
}
line Errore
PHP код:
switch(PlayerInfo[i][OnDuty])
{
case 0: AdmDuty = "Playing!";
case 1: AdmDuty = "On Duty!";
}
help please i realy needed help
Re: [NEW]ZCMD Admin Error -
Konstantinos - 26.10.2013
You cannot use switch for not a constant value. Change it to if/else if statements.
Re: [NEW]ZCMD Admin Error -
donhu789 - 26.10.2013
ok Bro
Re: [NEW]ZCMD Admin Error -
Hamam - 26.10.2013
Код:
CMD:admins(playerid, params[])
{
new string[256];
new fstring[64];
for(new i=0; i<MAX_PLAYERS; i++)
{
if(level[i] > 0)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(i,pname, sizeof(pname));
format(fstring, sizeof(fstring),"%s (%i) - {FF0000}Level: %i{FFFFFF}\n", pname, i, level[i]);
strcat(string, fstring, sizeof(string));
}
}
ShowPlayerDialog(playerid,2563,DIALOG_STYLE_LIST,"Online Admins",string,"OK","");
return 1;
}
Re: [NEW]ZCMD Admin Error -
donhu789 - 26.10.2013
PHP код:
C:\Documents and Settings\PhongLan\Desktop\New Folder (8)\gamemodes\SATDM_v14.pwn(20786) : error 014: invalid statement; not in switch
C:\Documents and Settings\PhongLan\Desktop\New Folder (8)\gamemodes\SATDM_v14.pwn(20786) : warning 215: expression has no effect
C:\Documents and Settings\PhongLan\Desktop\New Folder (8)\gamemodes\SATDM_v14.pwn(20786) : error 001: expected token: ";", but found ":"
C:\Documents and Settings\PhongLan\Desktop\New Folder (8)\gamemodes\SATDM_v14.pwn(20786) : error 029: invalid expression, assumed zero
C:\Documents and Settings\PhongLan\Desktop\New Folder (8)\gamemodes\SATDM_v14.pwn(20786) : fatal error 107: too many error messages on one line
Error
PHP код:
case 0: AdmDuty = "Playing!";
Please help
Re: [NEW]ZCMD Admin Error -
donhu789 - 26.10.2013
Anyone Possible To help me More i just got final