Hello.
Parameters:
(Text3D:id, playerid, Float:OffsetX, Float:OffsetY, Float:OffsetZ)
Text3D:id - The ID of the 3D Text label to attach.
playerid - The ID of the player to attach the 3D text label to.
OffsetX - The X offset from the player.
OffsetY - The Y offset from the player.
OffsetZ - The Z offset from the player.
Код:
new Team_Zombie[MAX_PLAYERS];
new Team_Admin[MAX_PLAYERS];
new Team_Cop[MAX_PLAYERS];
public OnGameModeInit()
{
AddPlayerClass(162,1682.0084,-1353.8291,159.6641,223.8957,0,0,0,0,0,0); // Zombie
AddPlayerClass(163,1958.3783, 1343.1572, 15.3746, 269.1425,3,1,22,50,29,500); // Admin
AddPlayerClass(267,1958.3783, 1343.1572, 15.3746, 269.1425,3,1,22,50,29,500); // Cop
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
switch (classid)
{
case 0: // Zombie Team
{
Team_Zombie[playerid] =1;
Team_Admin[playerid] =0;
Team_Cop[playerid] =0;
}
case 1: // Admin Team
{
Team_Admin[playerid] =1;
Team_Zombie[playerid] =0;
Team_Cop[playerid] =0;
}
case 2: // Cop Team
{
Team_Cop[playerid] =1;
' Team_Admin[playerid] =0;
Team_Zombie[playerid] =0;
}
}
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
if(Team_Admin[playerid] == 1)
{
if(!IsPlayerAdmin(playerid))
{
SendClientMessage(playerid,0xFFFFFFFF,"You may not spawn. Admins Only!");
return 0;
}
return 1;
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(Team_Zombie[playerid] == 1)
{
new Text3D:label = Create3DTextLabel("Zombie Team", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
SendClientMessage(playerid,0xFFFFFFFF,"You have joined the Zombie Team.");
return 1;
}
if(Team_Admin[playerid] == 1)
{
new Text3D:label = Create3DTextLabel("Admin Team", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
SendClientMessage(playerid,0xFFFFFFFF,"You have joined the Admin Team.");
return 1;
}
if(Team_Cop[playerid] == 1)
{
new Text3D:label = Create3DTextLabel("Cop Team", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
SendClientMessage(playerid,0xFFFFFFFF,"You have joined the Cop Team.");
return 1;
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
Team_Zombie[playerid] =0;
Team_Admin[playerid] =0;
Team_Cop[playerid] =0;
return 1;
}
Edit: Sorry, i accidentally posted unfinished code.
Hope it helps
.