24.05.2010, 10:36
Quote:
Originally Posted by Bomba || ❶❸❸❼
OnPlayerSpawn put this:
SetPlayerPos |
Here is part of a code I use...
Under OnGameModeInit...
pawn Код:
// PlayerClasses
// Aztecas //
AddPlayerClassEx(0, 292, 1673.6190, -2122.3142, 14.1460, 296.6250, 0,0, 0,0, 0,0);
AddPlayerClassEx(0, 115, 1673.6190, -2122.3142, 14.1460, 296.6250, 0,0, 0,0, 0,0);
AddPlayerClassEx(0, 116, 1673.6190, -2122.3142, 14.1460, 296.6250, 0,0, 0,0, 0,0);
AddPlayerClassEx(0, 41, 1673.6190, -2122.3142, 14.1460, 296.6250, 0,0, 0,0, 0,0);
// Vagos //
AddPlayerClassEx(1, 108, 2626.4180, -1098.8073, 69.3514, 280.0232, 0,0, 0,0, 0,0);
AddPlayerClassEx(1, 109, 2626.4180, -1098.8073, 69.3514, 280.0232, 0,0, 0,0, 0,0);
AddPlayerClassEx(1, 110, 2626.4180, -1098.8073, 69.3514, 280.0232, 0,0, 0,0, 0,0);
AddPlayerClassEx(1, 215, 2626.4180, -1098.8073, 69.3514, 280.0232, 0,0, 0,0, 0,0);
// Ballas //
AddPlayerClassEx(2, 102, 2277.6997, -1134.3367, 1050.8984, 264.2271, 0,0, 0,0, 0,0);
AddPlayerClassEx(2, 103, 2277.6997, -1134.3367, 1050.8984, 264.2271, 0,0, 0,0, 0,0);
AddPlayerClassEx(2, 104, 2277.6997, -1134.3367, 1050.8984, 264.2271, 0,0, 0,0, 0,0);
AddPlayerClassEx(2, 13, 2277.6997, -1134.3367, 1050.8984, 264.2271, 0,0, 0,0, 0,0);
// Grove //
AddPlayerClassEx(3, 269, 2525.9170, -1674.7805, 1015.4986, 270.4626, 0,0, 0,0, 0,0);
AddPlayerClassEx(3, 270, 2525.9170, -1674.7805, 1015.4986, 270.4626, 0,0, 0,0, 0,0);
AddPlayerClassEx(3, 271, 2525.9170, -1674.7805, 1015.4986, 270.4626, 0,0, 0,0, 0,0);
AddPlayerClassEx(3, 195, 2525.9170, -1674.7805, 1015.4986, 270.4626, 0,0, 0,0, 0,0);
// Dealers //
AddPlayerClassEx(4, 28, 2744.3135, -1960.9834, 21.7099, 262.9126, 0,0, 0,0, 0,0);
AddPlayerClassEx(4, 29, 2744.3135, -1960.9834, 21.7099, 262.9126, 0,0, 0,0, 0,0);
AddPlayerClassEx(4, 30, 2744.3135, -1960.9834, 21.7099, 262.9126, 0,0, 0,0, 0,0);
AddPlayerClassEx(4, 12, 2744.3135, -1960.9834, 21.7099, 262.9126, 0,0, 0,0, 0,0);
// Cops //
AddPlayerClassEx(5, 265, 218.3181, 69.2598, 1005.0391, 272.1958, 0,0, 0,0, 0,0);
AddPlayerClassEx(5, 266, 218.3181, 69.2598, 1005.0391, 272.1958, 0,0, 0,0, 0,0);
AddPlayerClassEx(5, 267, 218.3181, 69.2598, 1005.0391, 272.1958, 0,0, 0,0, 0,0);
AddPlayerClassEx(5, 246, 218.3181, 69.2598, 1005.0391, 272.1958, 0,0, 0,0, 0,0);
// Bikers //
AddPlayerClassEx(6, 100, 865.1848, -1634.4077, 14.9297, 176.2746, 0,0, 0,0, 0,0);
AddPlayerClassEx(6, 247, 865.1848, -1634.4077, 14.9297, 176.2746, 0,0, 0,0, 0,0);
AddPlayerClassEx(6, 248, 865.1848, -1634.4077, 14.9297, 176.2746, 0,0, 0,0, 0,0);
AddPlayerClassEx(6, 201, 865.1848, -1634.4077, 14.9297, 176.2746, 0,0, 0,0, 0,0);
// Rappers //
AddPlayerClassEx(7, 293, 1252.9651, -795.6196, 1084.2344, 313.6620, 0,0, 0,0, 0,0);
AddPlayerClassEx(7, 297, 1252.9651, -795.6196, 1084.2344, 313.6620, 0,0, 0,0, 0,0);
AddPlayerClassEx(7, 19, 1252.9651, -795.6196, 1084.2344, 313.6620, 0,0, 0,0, 0,0);
AddPlayerClassEx(7, 233, 1252.9651, -795.6196, 1084.2344, 313.6620, 0,0, 0,0, 0,0);
// Hoodlums //
AddPlayerClassEx(8, 183, 2746.2112, -2454.1011, 16.6562, 271.6301, 0,0, 0,0, 0,0);
AddPlayerClassEx(8, 21, 2746.2112, -2454.1011, 16.6562, 271.6301, 0,0, 0,0, 0,0);
AddPlayerClassEx(8, 22, 2746.2112, -2454.1011, 16.6562, 271.6301, 0,0, 0,0, 0,0);
AddPlayerClassEx(8, 190, 2746.2112, -2454.1011, 16.6562, 271.6301, 0,0, 0,0, 0,0);
// Workers //
AddPlayerClassEx(9, 27, 1227.4185, -1243.5392, 19.6232, 222.0879, 0,0, 0,0, 0,0);
AddPlayerClassEx(9, 153, 1227.4185, -1243.5392, 19.6232, 222.0879, 0,0, 0,0, 0,0);
AddPlayerClassEx(9, 16, 1227.4185, -1243.5392, 19.6232, 222.0879, 0,0, 0,0, 0,0);
AddPlayerClassEx(9, 192, 1227.4185, -1243.5392, 19.6232, 222.0879, 0,0, 0,0, 0,0);
// Admins //
AddPlayerClassEx(10, 217, 1117.7378, -2038.7366, 78.2109, 270.3770, 0,0, 0,0, 0,0);
AddPlayerClassEx(10, 211, 1117.7378, -2038.7366, 78.2109, 270.3770, 0,0, 0,0, 0,0);
pawn Код:
public OnPlayerRequestClass( playerid, classid )
{
PlayerInfo[playerid][ pClassID ] = classid;
if(PlayerInfo[playerid][justConn])
{
TogglePlayerSpectating(playerid, 1);
format(PlayerInfo[playerid][TempIntroString],256," ");
TextDrawBoxColor(text_fadeblack[playerid], 0x00000000);
PlayerInfo[playerid][introStringIndex] = 0;
PlayerInfo[playerid][FirstIntroFlash] = false;
PlayerInfo[playerid][EndedIntro] = false;
PlayerInfo[playerid][inIntro] = true;
PlayerInfo[playerid][introIndex] = 0;
PlayerInfo[playerid][justConn] = false;
PlayerInfo[playerid][justClass] = true;
PlayerInfo[playerid][introOffset] = 0;
TextDrawShowForPlayer(playerid, text_fadeblack[playerid]);
TextDrawShowForPlayer(playerid, skip_intro);
TextDrawBoxColor(text_fadeblack[playerid], 0x00000005);
TextDrawShowForPlayer(playerid, intro_gmname[playerid]);
TextDrawSetString(intro_gmname[playerid], " ");
PlayerPlaySound(playerid, 1142, 0, 0, 0);
PlayerInfo[playerid][introTimer] = SetTimerEx("Intro", 25, true, "i", playerid);
return 0;
}
if(PlayerInfo[playerid][inIntro]) {
return 0;
}
PlayerInfo[playerid][RequestingClass] = true;
SetPlayerPos(playerid, player_x,player_y,player_z);
SetPlayerFacingAngle(playerid, player_angle);
SetPlayerCameraPos(playerid, camera_x,camera_y,camera_z);
SetPlayerCameraLookAt(playerid, player_x,player_y,player_z);
ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1); //smooth dancing. It's most fitting to the music
PlayerPlaySound(playerid, 1097,-119.9460,23.1096,12.2238); //music, duh
//making sure the timer gets executed only once, so the camera doesn't go to fast
if (PlayerInfo[playerid][SpawnDance]) PlayerInfo[playerid][SpawnTimer] = SetTimerEx("MoveCamera", moving_speed, true, "i", playerid);
PlayerInfo[playerid][SpawnDance] = false; //preventing the timer to execute again
//------------------------------------------------
TextDrawHideForPlayer(playerid, text_fadeblack[playerid]);
TextDrawHideForPlayer(playerid, intro_gmname[playerid]);
TextDrawShowForPlayer(playerid,WideScreenUp);
TextDrawShowForPlayer(playerid,WideScreenDown);
SetPlayerColor( playerid, COLOR_INACTIVE );
switch(classid)
{
case 0..3: {
GameTextForPlayer(playerid, "~n~~n~~w~]~b~~h~~h~Aztecas~w~]", 3000, 3);
}
case 4..7: {
GameTextForPlayer(playerid, "~n~~n~~w~]~y~Vagos~w~]", 3000, 3);
}
case 8..11: {
GameTextForPlayer(playerid, "~n~~n~~w~]~p~Ballas~w~]", 3000, 3);
}
case 12..15: {
GameTextForPlayer(playerid, "~n~~n~~w~]~g~Grove Street Families~w~]", 3000, 3);
}
case 16..19: {
GameTextForPlayer(playerid, "~n~~n~~w~]~p~~h~~h~Dealers~w~]", 3000, 3);
}
case 20..23: {
GameTextForPlayer(playerid, "~n~~n~~w~]~b~Cops~w~]", 3000, 3);
}
case 24..27: {
GameTextForPlayer(playerid, "~n~~n~~w~]~g~~h~~h~Bikers~w~]", 3000, 3);
}
case 28..31: {
GameTextForPlayer(playerid, "~n~~n~~w~]~r~~h~~h~Rappers~w~]", 3000, 3);
}
case 32..35: {
GameTextForPlayer(playerid, "~n~~n~~w~]~r~Hoodlums~w~]", 3000, 3);
}
case 36..39: {
GameTextForPlayer( playerid, "~n~~n~~w~]~b~~h~Workers~w~]", 3000, 3 );
}
case 40..41: {
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~r~]~w~Admins~r~] ~n~~r~Admins Only!", 3000, 3);
}
}
return 1;
}