public OnPlayerRequestClass(playerid, classid)
{
Update3DTextLabelText(RankLabel[playerid], 0xFFFFFFFF, " ");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
switch(classid)
{
case 0:
{
// TERRORISTS //
SetPlayerFacingAngle(playerid,280.0);
SetPlayerPos(playerid, -382.5999,2206.6169,42.4236);
SetPlayerCameraPos(playerid, -379.5999,2206.6169,42.4236);
SetPlayerCameraLookAt(playerid, -382.5999,2206.6169,42.4236, CAMERA_MOVE);
TextDrawHideForPlayer(playerid, A);
TextDrawHideForPlayer(playerid, S);
TextDrawHideForPlayer(playerid, U);
TextDrawHideForPlayer(playerid, A2);
TextDrawShowForPlayer(playerid, E);
gTeam[playerid] = TEAM_TERRORISTS;
SetPlayerTeam(playerid, 0);
SetPlayerSkin(playerid, 124);
SetPlayerColor(playerid, TEAM_TERRORISTS_COLOR);
Update3DTextLabelText(RankLabel[playerid], 0xFFFFFFFF, " ");
}
case 1:
{
// SWAT //
SetPlayerFacingAngle(playerid,180.0);
SetPlayerPos(playerid, 212.7791,1919.7570,17.6406);
SetPlayerCameraPos(playerid, 212.7791,1916.7570,17.6406);
SetPlayerCameraLookAt(playerid, 212.7791,1919.7570,17.6406, CAMERA_MOVE);
TextDrawShowForPlayer(playerid, A);
TextDrawHideForPlayer(playerid, S);
TextDrawHideForPlayer(playerid, U);
TextDrawHideForPlayer(playerid, A2);
TextDrawHideForPlayer(playerid, E);
SetPlayerTeam(playerid, 1);
SetPlayerSkin(playerid, 285);
gTeam[playerid] = TEAM_SWAT;
SetPlayerColor(playerid, TEAM_SWAT_COLOR);
Update3DTextLabelText(RankLabel[playerid], 0xFFFFFFFF, " ");
}
case 2:
{
// DONATOR //
SetPlayerFacingAngle(playerid, 250.0);
SetPlayerPos(playerid, 219.7300,1822.7803,7.5293);
SetPlayerCameraPos(playerid, 226.8338,1823.0217,7.4141);
SetPlayerCameraLookAt(playerid, 100.8338,1823.0217,7.4141, CAMERA_MOVE);
TextDrawShowForPlayer(playerid, S);
TextDrawHideForPlayer(playerid, A);
TextDrawHideForPlayer(playerid, U);
TextDrawHideForPlayer(playerid, A2);
TextDrawHideForPlayer(playerid, E);
SetPlayerSkin(playerid, 123);
SetPlayerTeam(playerid, 2);
gTeam[playerid] = TEAM_DONATOR;
SetPlayerColor(playerid, TEAM_DONATOR_COLOR);
Update3DTextLabelText(RankLabel[playerid], 0xFFFFFFFF, " ");
}
}
return 1;
}
// Enums
enum PlayerData
{
Registered,
LoggedIn,
Level,
Helper,
Tag,
dRank,
Muted,
Caps,
Jailed,
JailTime,
Frozen,
FreezeTime,
Kills,
Deaths,
hours,
mins,
secs,
TotalTime,
ConnectTime,
MuteWarnings,
Warnings,
Spawned,
TimesSpawned,
God,
GodCar,
DoorsLocked,
SpamCount,
SpamTime,
PingCount,
PingTime,
blip,
blipS,
pColour,
pCar,
SpecID,
SpecType,
OnDuty,
bool:AllowedIn,
FailLogin
};
new PlayerInfo[MAX_PLAYERS][PlayerData];
enum ServerData
{
MaxPing,
ReadPMs,
ReadCmds,
MaxAdminLevel,
AdminOnlySkins,
AdminSkin,
AdminSkin2,
NameKick,
PartNameKick,
AntiSpam,
AntiSwear,
NoCaps,
Locked,
Password[128],
GiveWeap,
GiveMoney,
ConnectMessages,
AdminCmdMsg,
AutoLogin,
MaxMuteWarnings,
DisableChat,
MustLogin,
MustRegister,
};
public OnPlayerRequestSpawn(playerid)
{
if(GetPlayerSkin(playerid)==//Donator's skin id)
{
if(PlayerInfo[playerid][Level]<2)
{
SendClientMessage(playerid, -1, "You must be level 2 or above to select this class.");
return 0;
}
}
return 1;
}
Do it under OnPlayerRequestSpawn callback
PHP код:
|