25.05.2015, 14:22
Quote:
Код HTML:
public OnPlayerRequestClass(playerid, classid) { if(IsPlayerNPC(playerid)) return 1; SetPlayerTeamFromClass(playerid, classid); SetPlayerPos(playerid, 2116.0205, 2143.3225, 10.8203); SetPlayerFacingAngle(playerid, 89.6528); SetPlayerCameraLookAt(playerid, 2116.0205, 2143.3225, 10.8203); SetPlayerCameraPos(playerid, 2116.0205 + (5 * floatsin(-89.6528, degrees)), 2143.3225 + (5 * floatcos(-89.6528, degrees)), 10.8203); return 1; } Код HTML:
public OnPlayerRequestSpawn(playerid) { if(IsPlayerNPC(playerid)) return 1; if(IsLoggedIn{playerid} == 0) { SendClientMessage(playerid, RED, "You MUST be registered and logged in before you can spawn.") && Kick(playerid); return 0; } else if(GetTeam{playerid} == CLASS_COPS && PlayerInfo[playerid][pWanted] >= 1 || GetPlayerWantedLevel(playerid) >= 1) { SendClientMessage(playerid, RED, "You cant spawn as Law Enforcement while you have Wanted Level."); ForceClassSelection(playerid); return 0; } else if(GetTeam{playerid} == CLASS_ARMY) { if(PlayerInfo[playerid][pWanted] < 1 || GetPlayerWantedLevel(playerid) < 1) { if(DegreeInfo[playerid][dDefense] == 1) { return 1; } else { SendClientMessage(playerid, RED, "This command is restricted to Defense Degree."); GameTextForPlayer(playerid,"~r~Restricted Class", 3000, 5); ForceClassSelection(playerid); return 0; } } else { SendClientMessage(playerid, RED, "You cant spawn as Law Enforcement while you have Wanted Level."); ForceClassSelection(playerid); } return 0; } else if(GetTeam{playerid} == CLASS_CIA || GetTeam{playerid} == CLASS_FBI) { if(PlayerInfo[playerid][pWanted] < 1 || GetPlayerWantedLevel(playerid) < 1) { if(DegreeInfo[playerid][dLaw] == 1) { return 1; } else { SendClientMessage(playerid, RED, "This command is restricted to Law Degree."); GameTextForPlayer(playerid,"~r~Restricted Class", 3000, 5); ForceClassSelection(playerid); return 0; } } else { SendClientMessage(playerid, RED, "You cant spawn as Law Enforcement while you have Wanted Level."); ForceClassSelection(playerid); } return 0; } else if(GetTeam{playerid} == CLASS_MEDIC) { if(PlayerInfo[playerid][pWanted] < 1 || GetPlayerWantedLevel(playerid) < 1) { if(DegreeInfo[playerid][dHealth] == 1) { return 1; } else { SendClientMessage(playerid, RED, "This command is restricted to Medical Degree."); GameTextForPlayer(playerid,"~r~Restricted Class", 3000, 5); ForceClassSelection(playerid); return 0; } } else { SendClientMessage(playerid, RED, "You cant spawn as a Medic while you have Wanted Level."); ForceClassSelection(playerid); } return 0; } return 1; } |
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
if(IsLoggedIn{playerid} == 0)
{
SendClientMessage(playerid, RED, "You MUST be registered and logged in before you can spawn.") && Kick(playerid);
return 0;
}
else if(GetTeam{playerid} == CLASS_COPS && PlayerInfo[playerid][pWanted] >= 1 || GetPlayerWantedLevel(playerid) >= 1)
{
SendClientMessage(playerid, RED, "You cant spawn as Law Enforcement while you have Wanted Level.");
ForceClassSelection(playerid);
return 0;
}
else if(GetTeam{playerid} == CLASS_ARMY)
{
if(PlayerInfo[playerid][pWanted] < 1 || GetPlayerWantedLevel(playerid) < 1)
{
return 1;
}
else
{
SendClientMessage(playerid, RED, "You cant spawn as Law Enforcement while you have Wanted Level.");
ForceClassSelection(playerid);
}
return 0;
}
else if(GetTeam{playerid} == CLASS_CIA || GetTeam{playerid} == CLASS_FBI)
{
if(PlayerInfo[playerid][pWanted] < 1 || GetPlayerWantedLevel(playerid) < 1)
{
return 1;
}
else
{
SendClientMessage(playerid, RED, "You cant spawn as Law Enforcement while you have Wanted Level.");
ForceClassSelection(playerid);
}
return 0;
}
else if(GetTeam{playerid} == CLASS_MEDIC)
{
if(PlayerInfo[playerid][pWanted] < 1 || GetPlayerWantedLevel(playerid) < 1)
{
return 1;
}
else
{
SendClientMessage(playerid, RED, "You cant spawn as a Medic while you have Wanted Level.");
ForceClassSelection(playerid);
}
return 0;
}
return 1;
}