public OnPlayerRequestClass(playerid, classid)
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
SetPlayerTeamFromClass(playerid, classid);
switch(classid)
{
case 0..1: GameTextForPlayer(playerid, "~y~~h~STAT", 5000, 6);
case 2: GameTextForPlayer(playerid, "~b~~h~SWAT", 5000, 6);
case 3: GameTextForPlayer(playerid, "ARMY", 5000, 6);
case 4..12: GameTextForPlayer(playerid, "~b~POLICE", 5000, 6);
case 13..22: GameTextForPlayer(playerid, "~w~CIVILIAN", 5000, 6);
case 23: GameTextForPlayer(playerid, "~l~~w~HITMAN", 5000, 6);
case 24: GameTextForPlayer(playerid, "~w~MECHANIC", 5000, 6);
case 25: GameTextForPlayer(playerid, "~g~PARAMEDIC", 5000, 6);
}
return 1;
}
y_classes: |
#include <YSI\y_classes> #include <YSI\y_groups> |
new Group:gHighScoreGroup; In OnGameModeInit:
gHighScoreGroup = Group_Create("Over 350"); // Create the group with a description. and score for that group of skins... As you request... Class_Add(all, skin, info); // Replace your normal skin selection with this. // Create a class which only people in one group can use. Class_AddForGroup(gHighScoreGroup, rest, of, info);
stock GivePlayerScore(playerid, score) { // Add the score to their current score. score += GetPlayerScore(playerid); SetPlayerScore(playerid, score); if (score >= 350) { Group_SetPlayer(gHighScoreGroup, playerid, true); // High score, add them to the group. } else { Group_SetPlayer(gHighScoreGroup, playerid, false); // Low score, remove them from the group. } }
OK, using
At the top: pawn Code: Код:
new Group:gHighScoreGroup; In OnGameModeInit: Код:
gHighScoreGroup = Group_Create("Over 350"); // Create the group with a description. and score for that group of skins... As you request... Class_Add(all, skin, info); // Replace your normal skin selection with this. // Create a class which only people in one group can use. Class_AddForGroup(gHighScoreGroup, rest, of, info); pawn Code: Код:
stock GivePlayerScore(playerid, score) { // Add the score to their current score. score += GetPlayerScore(playerid); SetPlayerScore(playerid, score); if (score >= 350) { Group_SetPlayer(gHighScoreGroup, playerid, true); // High score, add them to the group. } else { Group_SetPlayer(gHighScoreGroup, playerid, false); // Low score, remove them from the group. } } |
If you can't say it better than someone else, quote those who said it best. |
new Team[MAX_PLAYERS] = -1;
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
SetPlayerTeamFromClass(playerid, classid);
switch(classid)
{
case 0..1:
{
GameTextForPlayer(playerid, "~y~~h~STAT", 5000, 6);
Team[playerid] = 1;
}
case 2:
{
GameTextForPlayer(playerid, "~b~~h~SWAT", 5000, 6);
Team[playerid] = 2;
}
case 3:
{
GameTextForPlayer(playerid, "ARMY", 5000, 6);
Team[playerid] = 3;
}
case 4..12:
{
GameTextForPlayer(playerid, "~b~POLICE", 5000, 6);
Team[playerid] = 4;
}
case 13..22:
{
GameTextForPlayer(playerid, "~w~CIVILIAN", 5000, 6);
Team[playerid] = 5;
}
case 23:
{
GameTextForPlayer(playerid, "~l~~w~HITMAN", 5000, 6);
Team[playerid] = 6;
}
case 24:
{
GameTextForPlayer(playerid, "~w~MECHANIC", 5000, 6);
Team[playerid] = 7;
}
case 25:
{
GameTextForPlayer(playerid, "~g~PARAMEDIC", 5000, 6);
Team[playerid] = 8;
}
}
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
switch(Team[playerid])
{
case 1: //Team STAT
{
if(GetPlayerScore(playerid) < 2000)
{
SendClientMessage(playerid, 0xCC0000AA, "You don't have the required score to play this team!");
return 0; //this will stop them from spawning
}
}
}
return 1;
}
pawn Код:
|