CMD:makeleader(playerid,params[])
{
new ID,ime[MAX_PLAYER_NAME],ime2[MAX_PLAYER_NAME],ORGID,poruka[128],poruka2[128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,""COLOR_CRVENA"Greska:{FFFFFF} Nemate dozvolu za tu komandu");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,1,""COLOR_CRVENA"Greska:{FFFFFF} Niste ulogirani na serveru");
if(sscanf(params,"ud",ID,ORGID)) return SendClientMessage(playerid,-1,"{FFFFFF}Koristenje:"COLOR_LAGANA" /makeleader [ID/Ime] [OrgID]");
if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,""COLOR_CRVENA"Greska:{FFFFFF} Igrac nije ulogiran na server");
if(ORGID > 3 || ORGID < 0) return SendClientMessage(playerid,-1,""COLOR_CRVENA"Greska:{FFFFFF} Maximum organizacija je '3'");
else
{
GetPlayerName(playerid,ime,sizeof(ime));
GetPlayerName(ID,ime2,sizeof(ime2));
format(poruka,sizeof(poruka),""COLOR_ZELENA2"[ORG-Info]:"COLOR_CRVENA" VLASNIK{FFFFFF} %s vam je postavio leadera organizacije. ORG: %s",ime,GetOrgName(ORGID));
SendClientMessage(ID,-1,poruka);
format(poruka,sizeof(poruka),""COLOR_WG"WG:{FFFFFF} Postavili ste lidera %s. ORG: %s",ime2,GetOrgName(ORGID));
SendClientMessage(playerid,-1,poruka);
format(poruka2,sizeof(poruka2),""COLOR_SIVA"[A-Obavijest]:{FFFFFF} %s je postavio %s leadera. ORG: %s",ime,ime2,GetOrgName(ORGID));
PlayerTeam[ID][ORG_Ime] = GetOrgName(ORGID);
PlayerTeam[ID][ORG_Leader] = 1;
}
return 1;
}
stock GetOrgName(orgid)
{
switch(orgid)
{
case 0: orgid = ORG_PD;
case 1: orgid = ORG_Bolnica;
case 2: orgid = ORG_News;
}
return 1;
}
GetOrgName(orgid)
{
new org_name[12];
switch(orgid)
{
case 0: strcat(org_name, "ORG_PD", sizeof (org_name));
case 1: strcat(org_name, "ORG_Bolnica", sizeof (org_name));
case 2: strcat(org_name, "ORG_News", sizeof (org_name));
default: strcat(org_name, "N/A", sizeof (org_name));
}
return org_name;
}
strcat((PlayerTeam[ID][ORG_Ime][0] = EOS, PlayerTeam[ID][ORG_Ime]), GetOrgName(ORGID), 12);
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1438) : error 001: expected token: ")", but found "["
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1438) : warning 215: expression has no effect
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1438) : error 001: expected token: ";", but found "]"
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1438) : error 029: invalid expression, assumed zero
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1438) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
CMD:makeleader(playerid,params[])
{
new ID,ime[MAX_PLAYER_NAME],ime2[MAX_PLAYER_NAME],ORGID,poruka[128],poruka2[128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,""COLOR_CRVENA"Greska:{FFFFFF} Nemate dozvolu za tu komandu");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,1,""COLOR_CRVENA"Greska:{FFFFFF} Niste ulogirani na serveru");
if(sscanf(params,"ud",ID,ORGID)) return SendClientMessage(playerid,-1,"{FFFFFF}Koristenje:"COLOR_LAGANA" /makeleader [ID/Ime] [OrgID]");
if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,""COLOR_CRVENA"Greska:{FFFFFF} Igrac nije ulogiran na server");
if(ORGID > 3 || ORGID < 0) return SendClientMessage(playerid,-1,""COLOR_CRVENA"Greska:{FFFFFF} Maximum organizacija je '3'");
else
{
GetPlayerName(playerid,ime,sizeof(ime));
GetPlayerName(ID,ime2,sizeof(ime2));
format(poruka,sizeof(poruka),""COLOR_ZELENA2"[ORG-Info]:"COLOR_CRVENA" VLASNIK{FFFFFF} %s vam je postavio leadera organizacije. ORG: %s",ime,GetOrgName(ORGID));
SendClientMessage(ID,-1,poruka);
format(poruka,sizeof(poruka),""COLOR_WG"WG:{FFFFFF} Postavili ste lidera %s. ORG: %s",ime2,GetOrgName(ORGID));
SendClientMessage(playerid,-1,poruka);
format(poruka2,sizeof(poruka2),""COLOR_SIVA"[A-Obavijest]:{FFFFFF} %s je postavio %s leadera. ORG: %s",ime,ime2,GetOrgName(ORGID));
// strcat((PlayerTeam[ID][ORG_Ime][0] = EOS, PlayerTeam[ID][ORG_Ime]), GetOrgName(ORGID), 12);
PlayerTeam[ID][ORG_Leader] = 1;
}
return 1;
}
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1442) : error 001: expected token: ")", but found "["
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1442) : warning 215: expression has no effect
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1442) : error 001: expected token: ";", but found "]"
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1442) : error 029: invalid expression, assumed zero
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1442) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
CMD:makeleader(playerid,params[])
{
new ID,ime[MAX_PLAYER_NAME],ime2[MAX_PLAYER_NAME],ORGID,poruka[128],poruka2[128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,""COLOR_CRVENA"Greska:{FFFFFF} Nemate dozvolu za tu komandu");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,1,""COLOR_CRVENA"Greska:{FFFFFF} Niste ulogirani na serveru");
if(sscanf(params,"ud",ID,ORGID)) return SendClientMessage(playerid,-1,"{FFFFFF}Koristenje:"COLOR_LAGANA" /makeleader [ID/Ime] [OrgID]");
if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,""COLOR_CRVENA"Greska:{FFFFFF} Igrac nije ulogiran na server");
if(ORGID > 3 || ORGID < 0) return SendClientMessage(playerid,-1,""COLOR_CRVENA"Greska:{FFFFFF} Maximum organizacija je '3'");
else
{
GetPlayerName(playerid,ime,sizeof(ime));
GetPlayerName(ID,ime2,sizeof(ime2));
format(poruka,sizeof(poruka),""COLOR_ZELENA2"[ORG-Info]:"COLOR_CRVENA" VLASNIK{FFFFFF} %s vam je postavio leadera organizacije. ORG: %s",ime,GetOrgName(ORGID));
SendClientMessage(ID,-1,poruka);
format(poruka,sizeof(poruka),""COLOR_WG"WG:{FFFFFF} Postavili ste lidera %s. ORG: %s",ime2,GetOrgName(ORGID));
SendClientMessage(playerid,-1,poruka);
format(poruka2,sizeof(poruka2),""COLOR_SIVA"[A-Obavijest]:{FFFFFF} %s je postavio %s leadera. ORG: %s",ime,ime2,GetOrgName(ORGID));
strcat((PlayerTeam[ID][ORG_Ime][0] = EOS, PlayerTeam[ID][ORG_Ime]), GetOrgName(ORGID), 12);
PlayerTeam[ID][ORG_Leader] = 1;
}
return 1;
}
strcat((PlayerTeam[ID][ORG_Ime][0] = EOS, PlayerTeam[ID][ORG_Ime]), GetOrgName(ORGID), 12);
enum pTeam
{
ORG_Ime,
ORG_Rank,
ORG_Leader
};
new PlayerTeam[MAX_PLAYERS][pTeam];
[..] Also since ORG_Ime is string, it should have a size in the enum.
|
enum some_name_used_for_PlayerTeam_array
{
...,
ORG_Ime[12],
...
};