Guest User

Untitled

a guest
Feb 9th, 2012
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.81 KB | None | 0 0
  1. public OnPlayerSpawn(playerid)
  2. {
  3.     ApplyAnimation(playerid, "MISC", "null",0.0,0,0,0,0,0);
  4.     SetPVarInt(playerid, "alahambra", 0);
  5.  
  6.     // Re-load osticks
  7.     for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
  8.     {
  9.         if(ostick[playerid][i][os_model])
  10.         {
  11.             SetPlayerAttachedObject(playerid, i, ostick[playerid][i][os_model],ostick[playerid][i][os_bone],ostick[playerid][i][os_x],ostick[playerid][i][os_y],ostick[playerid][i][os_z],ostick[playerid][i][os_rx],ostick[playerid][i][os_ry],ostick[playerid][i][os_rz],ostick[playerid][i][os_scalex],ostick[playerid][i][os_scaley],ostick[playerid][i][os_scalez]);
  12.         }
  13.     }
  14.  
  15.     if(!pWorld[playerid] && GetPVarInt(playerid, "Logged") != LOGIN_STATUS_LOGIN && !GetPVarInt(playerid, "tut_stage")) SetPlayerVirtualWorld(playerid, 0);
  16.  
  17.     if(GetPVarInt(playerid, "Logged") == LOGIN_STATUS_LOGGED || GetPVarInt(playerid, "Logged") == LOGIN_STATUS_REGISTER)
  18.     {
  19.         if(GetPVarInt(playerid, "UFS")) SetPlayerSkin(playerid, GetPVarInt(playerid, "Skin"));
  20.         else SetPlayerSkin(playerid, GetPVarInt(playerid, "TempSkin"));
  21.     }
  22.  
  23.     if(GetPVarInt(playerid, "Logged") == LOGIN_STATUS_LOGIN) return 1;
  24.  
  25.     SetPlayerArmour(playerid, 0);
  26.     if(GetPVarInt(playerid, "Logged") == LOGIN_STATUS_LOGGED) SetPlayerTime(playerid, curPlayerHour[playerid], curPlayerMin[playerid]);
  27.     else SetPlayerTime(playerid, DEFAULT_HOUR, DEFAULT_MINUTE);
  28.     DisablePlayerRaceCheckpoint(playerid);
  29.     TogglePlayerControllable(playerid, 1);
  30.     SetPlayerWeather(playerid, curPlayerWeather[playerid]);
  31.  
  32.     if(GetPVarFloat(playerid, "SPAWN_X") == 0 && GetPVarFloat(playerid, "SPAWN_Y") == 0 && GetPVarFloat(playerid, "SPAWN_Z") == 0 && !pExitVehicle[playerid])
  33.     {
  34.         SetPlayerPos(playerid, 1901+random(51), 679+random(4), 10.8203);
  35.         SetPlayerMapIcon(playerid, MAP_ICON_SPAWN, 1925.1892, 703.1492, 16.0190, 38, 0, MAPICON_GLOBAL);
  36.         SetPlayerInt(playerid, 0);
  37.     }
  38.  
  39.     if(GetPVarInt(playerid, "Logged") == LOGIN_STATUS_REGISTER && !pExitVehicle[playerid])
  40.     {
  41.         SetPlayerPos(playerid, 1901+random(51), 679+random(4), 10.8203);
  42.         SetPlayerMapIcon(playerid, MAP_ICON_SPAWN, 1925.1892, 703.1492, 16.0190, 38, 0, MAPICON_GLOBAL);
  43.         SetPlayerInt(playerid, 0);
  44.     }
  45.  
  46.     if(GetPVarInt(playerid, "Logged") == LOGIN_STATUS_LOGGED && !pExitVehicle[playerid] && GetPVarFloat(playerid, "SPAWN_X") != 0 && GetPVarFloat(playerid, "SPAWN_Y") != 0 && GetPVarFloat(playerid, "SPAWN_Z") != 0)
  47.     {
  48.         SetPlayerInt(playerid, GetPVarInt(playerid, "SPAWN_I"));
  49.         Streamer_UpdateEx(playerid, GetPVarFloat(playerid, "SPAWN_X"), GetPVarFloat(playerid, "SPAWN_Y"), GetPVarFloat(playerid, "SPAWN_Z"));
  50.         SetPlayerPos(playerid, GetPVarFloat(playerid, "SPAWN_X"), GetPVarFloat(playerid, "SPAWN_Y"), GetPVarFloat(playerid, "SPAWN_Z"));
  51.         SetPlayerMapIcon(playerid, MAP_ICON_SPAWN, GetPVarFloat(playerid, "SPAWN_X"), GetPVarFloat(playerid, "SPAWN_Y"), GetPVarFloat(playerid, "SPAWN_Z"), 38, 0, MAPICON_GLOBAL);
  52.         if(GetPVarInt(playerid, "SPAWNVEH"))
  53.         {
  54.             new vid;
  55.             #if GLOBAL_VCOLOR != -1
  56.             if(!pWorld[playerid] && GetPlayerLevel(playerid) < LEVEL_MOD) vid = CreateVehicleEx(GetPVarInt(playerid, "SPAWNVEH"), GetPVarFloat(playerid, "SPAWN_X"),GetPVarFloat(playerid, "SPAWN_Y"),GetPVarFloat(playerid, "SPAWN_Z") + 1.0, 0, GLOBAL_VCOLOR, GLOBAL_VCOLOR2, 60);
  57.             else vid = CreateVehicleEx(GetPVarInt(playerid, "SPAWNVEH"), GetPVarFloat(playerid, "SPAWN_X"),GetPVarFloat(playerid, "SPAWN_Y"),GetPVarFloat(playerid, "SPAWN_Z") + 1.0, 0, GetPVarInt(playerid, "vcolor"), GetPVarInt(playerid, "vcolor2"), -1);
  58.             #else
  59.             if(!pWorld[playerid] && GetPlayerLevel(playerid) < LEVEL_MOD) vid = CreateVehicleEx(GetPVarInt(playerid, "SPAWNVEH"), GetPVarFloat(playerid, "SPAWN_X"),GetPVarFloat(playerid, "SPAWN_Y"),GetPVarFloat(playerid, "SPAWN_Z") + 1.0, 0, GLOBAL_VCOLOR, GLOBAL_VCOLOR2, 60);
  60.             else vid = CreateVehicleEx(GetPVarInt(playerid, "SPAWNVEH"), GetPVarFloat(playerid, "SPAWN_X"),GetPVarFloat(playerid, "SPAWN_Y"),GetPVarFloat(playerid, "SPAWN_Z") + 1.0, 0, GetPVarInt(playerid, "vcolor"), GetPVarInt(playerid, "vcolor2"), -1);
  61.             #endif
  62.             Vehicle[vid][driver] = playerid;
  63.             new color1[16];
  64.             if(GetPVarInt(playerid, "Color") == -1)
  65.             {
  66.                 if(IsMike(playerid)) color1 = "FFD720";
  67.                 else format(color1, 16, "%s", PlayerColors2[playerid]);
  68.             }
  69.             else format(color1, 16, "%s", PlayerColors2[GetPVarInt(playerid, "Color")]);
  70.             format(szString, sizeof(szString), "{%s}%s", color1, pName[playerid]);
  71.             SetVehicleNumberPlate(vid, szString);
  72.             SetVehicleInterior(vid, GetPVarInt(playerid, "SPAWN_I"));
  73.             if(!pWorld[playerid]) SetVehicleVirtualWorld(vid, 0);
  74.             else SetVehicleVirtualWorld(vid, GetPlayerVirtualWorld(playerid));
  75.             Vehicle[vid][pjob] = 255;
  76.             PutPlayerInVehicle(playerid, vid, 0);
  77.             SetVehicleZAngle(vid, GetPVarFloat(playerid, "SPAWN_A"));
  78.         }
  79.         else SetPlayerFacingAngle(playerid, GetPVarFloat(playerid, "SPAWN_A"));
  80.     }
  81.  
  82.     SetCameraBehindPlayer(playerid);   
  83.     return 1;
  84. }
Advertisement
Add Comment
Please, Sign In to add comment