#define TEAM_PAKISTAN 0
#define TEAM_GERMANY 1
#define TEAM_USA 2
#define TEAM_RUSSIA 3
#define TEAM_INDIA 4
#define TEAM_PAKISTAN 0
#define TEAM_GERMANY 1
#define TEAM_USA 2
#define TEAM_RUSSIA 3
#define TEAM_INDIA 4
static gTeam[MAX_PLAYERS];
public SetPlayerToTeamColor(playerid)
{
if(gTeam[playerid] == TEAM_PAKISTAN) {
SetPlayerColor(playerid,TEAM_PAKISTAN_COLOR);
} else if(gTeam[playerid] == )......//and so on for all teams
}
}
public SetPlayerTeamFromClass(playerid,classid)
{
// Set their team number based on the class they selected.
if(classid == 0 )
{
gTeam[playerid] = TEAM_PAKISTAN;
SetPlayerTeam(playerid,TEAM_PAKISTAN);
}
else if(classid == 1)
{
//so on for all teams
}
public SetPlayerToTeamColor(playerid)
{
if(gTeam[playerid] == TEAM_PAKISTAN) {
SetPlayerColor(playerid,0x008000FF);
} else if(gTeam[playerid] ==TEAM_GERMANY) {
SetPlayerColor(playerid,ORANGE);
} else if(gTeam[playerid] ==TEAM_USA) {
SetPlayerColor(playerid,BLUE);
} else if(gTeam[playerid] ==TEAM_RUSSIA) {
SetPlayerColor(playerid,RED);
} else if(gTeam[playerid] ==TEAM_INDIA) {
SetPlayerColor(playerid,YELLOW);
}
}
E:\UDCSER~1\GAMEMO~1\Wars.pwn(778) : warning 235: public function lacks forward declaration (symbol "SetPlayerToTeamColor")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Warning.
forward SetPlayerToTeamColor(playerid);
CMD:fly(playerid,parmas[])
{
if(IsPlayerLuxAdminLevel(playerid,2))
{
StartFly(playerid);
}
else SendClientMessage(playerid, COLOR_RED, "ERROR: You need to be on level 5 to use this CMD");
return 1;
}
CMD:stopfly(playerid,parmas[])
{
if(IsPlayerLuxAdminLevel(playerid,2))
{
StopFly(playerid);
}
else SendClientMessage(playerid, COLOR_RED, "ERROR: You need to be on level 5 to use this CMD");
return 1;
}
CMD:onduty(playerid,parmas[])
{
if(IsPlayerLuxAdminLevel(playerid,2))
{
SetPlayerSkin(playerid,217);
GivePlayerWeapon(playerid,38,500000);
SetPlayerHealth(playerid,999999999);
SetPlayerArmour(playerid,999999999);
SetPlayerColor(playerid,COLOR_PINK);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"ADM CMD: %s is Now On An Admin Duty",pName);
SendClientMessageToAll(0xFF66FFAA,string);
}
else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not Administrator of Level 2");
return 1;
}
CMD:offduty(playerid,parmas[])
{
if(IsPlayerLuxAdminLevel(playerid,2))
{
ResetPlayerWeapons(playerid);
ForceClassSelection(playerid);
SetPlayerHealth(playerid,0);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"ADM CMD: %s is End With His Admin Duty",pName);
SendClientMessageToAll(0xFF66FFAA,string);
}
else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not Administrator of Level 2");
return 1;
}
enum PlayerInfo
{
pDuty,
}
new pInfo[MAX_PLAYERS][PlayerInfo];
CMD:onduty(playerid,parmas[])
{
if(IsPlayerLuxAdminLevel(playerid,2))
{
SetPlayerSkin(playerid,217);
GivePlayerWeapon(playerid,38,500000);
SetPlayerHealth(playerid,999999999);
SetPlayerArmour(playerid,999999999);
SetPlayerColor(playerid,COLOR_PINK);
pInfo[playerid][pDuty] = 1; //Player is now on duty
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"ADM CMD: %s is Now On An Admin Duty",pName);
SendClientMessageToAll(0xFF66FFAA,string);
}
else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not Administrator of Level 2");
return 1;
}
CMD:offduty(playerid,parmas[])
{
if(IsPlayerLuxAdminLevel(playerid,2))
{
pInfo[playerid][pDuty] = 0;//Player is off duty
ResetPlayerWeapons(playerid);
ForceClassSelection(playerid);
SetPlayerHealth(playerid,0);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"ADM CMD: %s is End With His Admin Duty",pName);
SendClientMessageToAll(0xFF66FFAA,string);
}
else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not Administrator of Level 2");
return 1;
}
CMD:fly(playerid,parmas[])
{
if(IsPlayerLuxAdminLevel(playerid,2))
{
if (pInfo[playerid][pDuty] == 0) return SendClientMessage(playerid, COLOR_RED,"ERROR: You must be on duty to use this cmd.");
else StartFly(playerid);
}
else SendClientMessage(playerid, COLOR_RED, "ERROR: You need to be on level 5 to use this CMD");
return 1;
}
CMD:stopfly(playerid,parmas[])
{
if(IsPlayerLuxAdminLevel(playerid,2))
{
StopFly(playerid);
}
else SendClientMessage(playerid, COLOR_RED, "ERROR: You need to be on level 5 to use this CMD");
return 1;
}
Roxor Bro i am not understanding SETPLAYERTEAMTOCLASS. Please define it more clearly... I shall be very thank full to you..
|
public SetPlayerTeamFromClass(playerid,classid)
{
if(classid == 0 )
{
gTeam[playerid] = TEAM_PAKISTAN;
SetPlayerTeam(playerid,TEAM_PAKISTAN);
}
else if(classid == 1)
{
gTeam[playerid] = TEAM_GERMANY;
SetPlayerTeam(playerid,TEAM_GERMANY);
}
else if(classid == 2)
{
gTeam[playerid] = TEAM_USA;
SetPlayerTeam(playerid,TEAM_USA);
}
else if(classid == 3)
{
gTeam[playerid] = TEAM_RUSSIA;
SetPlayerTeam(playerid,TEAM_RUSSIA);
}
else if(classid == 4)
{
gTeam[playerid] = TEAM_INDIA;
SetPlayerTeam(playerid,TEAM_INDIA);
}
}
E:\UDCSER~1\GAMEMO~1\Wars.pwn(1736) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.