14.01.2011, 02:21
Can anyone help me to move team skins at the start and normal skins after please.
public OnGameModeInit
public OnPlayerRequestClass
public OnGameModeInit
Код:
for (new i=0;i<Classes;i++) AddPlayerClass(ClassInfo[i],0,0,0,0,SpawnWeapons[0],SpawnWeapons[1],SpawnWeapons[2],SpawnWeapons[3],SpawnWeapons[4],SpawnWeapons[5]); #if defined Teams new TeamClasses; for (new i=0;i<Teams;i++) { for (new j=0;j<ModelsInTeam;j++) { if (TeamInfo[i][TeamModels][j] == 0) break; AddPlayerClass(TeamInfo[i][TeamModels][j],TeamInfo[i][TeamSpawnX],TeamInfo[i][TeamSpawnY],TeamInfo[i][TeamSpawnZ],TeamInfo[i][TeamSpawnA],SpawnWeapons[0],SpawnWeapons[1],SpawnWeapons[2],SpawnWeapons[3],SpawnWeapons[4],SpawnWeapons[5]); if (j == 0) TeamInfo[i][TeamClassStart] = Classes+TeamClasses; TeamClasses++; } TeamInfo[i][TeamClassEnd] = Classes+TeamClasses-1; } format(str,sizeof(str),"Classes: %d",Classes+TeamClasses); #else format(str,sizeof(str),"Classes: %d",Classes); #endif WriteToLog(str); new models[212],modelids; for (new i=0;i<Vehicles;i++) { AddStaticVehicle(VehicleInfo[i][VehicleModelID],VehicleInfo[i][VehicleSpawnX],VehicleInfo[i][VehicleSpawnY],VehicleInfo[i][VehicleSpawnZ],VehicleInfo[i][VehicleSpawnA],VehicleInfo[i][VehicleColor1],VehicleInfo[i][VehicleColor2]); if (VehicleInfo[i][VehicleModelID] != 0) models[VehicleInfo[i][VehicleModelID]-400]++; } for (new i=0;i<212;i++) if (models[i] > 0) modelids++; format(str,sizeof(str),"Vehicles: %d (Types: %d)",Vehicles,modelids); WriteToLog(str); for (new i=0;i<Pickups;i++) AddStaticPickup(PickupInfo[i][PickupModelID],PickupInfo[i][PickupType],PickupInfo[i][PickupSpawnX],PickupInfo[i][PickupSpawnY],PickupInfo[i][PickupSpawnZ]); format(str,sizeof(str),"Pickups: %d",Pickups); WriteToLog(str); #if defined Teams format(str,sizeof(str),"Teams: %d",Teams); WriteToLog(str);
Код:
PlayerPlaySound(playerid,1097,0,0,0); if (classid < Classes) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,1481.4418,-1790.4611,156.7533); SetPlayerFacingAngle(playerid,180); SetPlayerCameraPos(playerid,1481.4418,-1795.4611,156.7533); SetPlayerCameraLookAt(playerid,1481.4418,-1790.4611,156.7533); #if defined Teams PlayerInfo[playerid][Team] = -1; #endif new vehicleid = random(Vehicles); while (VehicleInfo[vehicleid][VehicleColor1] != -1 || VehicleInfo[vehicleid][VehicleColor2] != -1) vehicleid = random(Vehicles); if (!PlayerInfo[playerid][ModelSet]) PlayerInfo[playerid][ModelSet] = true; else PlayerInfo[playerid][Model] = classid; SetSpawnInfo(playerid,0,ClassInfo[PlayerInfo[playerid][Model]],VehicleInfo[vehicleid][VehicleSpawnX]+3,VehicleInfo[vehicleid][VehicleSpawnY]+3,VehicleInfo[vehicleid][VehicleSpawnZ],VehicleInfo[vehicleid][VehicleSpawnA],SpawnWeapons[0],SpawnWeapons[1],SpawnWeapons[2],SpawnWeapons[3],SpawnWeapons[4],SpawnWeapons[5]); } #if defined Teams else { new players,teammates,str[MAX_STRING]; for (new i=0;i<MAX_PLAYERS;i++) if (IsPlayerConnected(i)) players++; for (new i=0;i<Teams;i++) { if (TeamInfo[i][TeamClassStart] <= classid <= TeamInfo[i][TeamClassEnd]) { format(str,sizeof(str),"%s ~w~Team",TeamInfo[i][TeamName]); teammates = 0; for (new j=0;j<MAX_PLAYERS;j++) if (IsPlayerConnected(j) && PlayerInfo[j][Team] == i && j != playerid) teammates++; if (teammates < players/2+1) { PlayerInfo[playerid][Team] = i; SetPlayerInterior(playerid,TeamInfo[i][TeamSpawnInterior]); SetPlayerPos(playerid,TeamInfo[i][TeamSpawnX],TeamInfo[i][TeamSpawnY],TeamInfo[i][TeamSpawnZ]); SetPlayerFacingAngle(playerid,TeamInfo[i][TeamSpawnA]); SetPlayerCameraPos(playerid,TeamInfo[i][TeamSpawnX]+(floatsin(-TeamInfo[i][TeamSpawnA],degrees)*5),TeamInfo[i][TeamSpawnY]+(floatcos(-TeamInfo[i][TeamSpawnA],degrees)*5),TeamInfo[i][TeamSpawnZ]); SetPlayerCameraLookAt(playerid,TeamInfo[i][TeamSpawnX],TeamInfo[i][TeamSpawnY],TeamInfo[i][TeamSpawnZ]); } else strcat(str,"~n~~r~FULL"); GameTextForPlayer(playerid,str,1000,3); break; } } } #endif return 1; }