Help spawn
#1

Hi

I have got one problem. When I click spawn on class selection it spawn me but it dont show me map objects-buildings and other stuff.Go down for script lines


Picture
Here it show me just some objects but no map

Here no objects show.


pawn Код:
#include <a_samp>
#include <dini>
#include <zcmd>
#include <sscanf2>


#define ClassTruckDriver                    1
#define ClassBusDriver                      2
#define ClassPilot                      3
#define ClassPolice                     4
#define ClassMafia      5
#define ClassPizzaBoy       6
#define ClassAssistance      7
#define ClassRoadWorker          8

enum Adata
{
Password,
PlayerScore,
Adminlevel,
ReadRules,
PlayerClass,
PlayerTeam
}
new PlayerInfo[MAX_PLAYERS][Adata];
main()
{
}


CMD:reclass(playerid,params[])
{
ForceClassSelection(playerid);
SetPlayerHealth(playerid, 0.0);
return 1;
}

public OnGameModeInit()
{
AddPlayerClass(133, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 0 = Truck driver
AddPlayerClass(201, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 1 = Truck driver
AddPlayerClass(202, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 2 = Truck driver
AddPlayerClass(234, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 3 = Truck driver
AddPlayerClass(258, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 4 = Truck driver
AddPlayerClass(261, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 5 = Truck driver
AddPlayerClass(206, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 6 = Truck driver
AddPlayerClass(34, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 7 = Truck driver

AddPlayerClass(255, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 8 = Bus driver
AddPlayerClass(253, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 9 = Bus driver

AddPlayerClass(61, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 10 = Pilot

AddPlayerClass(280, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 11 = Police
AddPlayerClass(282, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 12 = Police
AddPlayerClass(283, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 13 = Police

AddPlayerClass(111, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 14 = Mafia
AddPlayerClass(112, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 15 = Mafia
AddPlayerClass(113, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 16 = Mafia

AddPlayerClass(250, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 17 = PizzaBoy
AddPlayerClass(193, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 18 = PizzaBoy

AddPlayerClass(50, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 19 = Assistance

AddPlayerClass(16, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 20 = Roadworker
AddPlayerClass(27, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 21 = Roadworker
AddPlayerClass(260, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 22 = Roadworker
}
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);

// Display a short message to inform the player about the class he's about to choose
switch (classid)
{
case 0, 1, 2, 3, 4, 5, 6, 7: // Classes that will be truckdrivers
{
// Display the name of the class
GameTextForPlayer(playerid, "Trucker", 3000, 4);
// Store the class for the player (truckdriver)
PlayerInfo[playerid][PlayerTeam] = ClassTruckDriver;

}
case 8, 9: // Classes that will be bus-drivers
{
// Display the name of the class
GameTextForPlayer(playerid, "Bus Driver", 3000, 4);
// Store the class for the player (busdriver)
PlayerInfo[playerid][PlayerTeam] = ClassBusDriver;
}
case 10: // Classes that will be Pilot
{
// Display the name of the class
GameTextForPlayer(playerid, "Pilot", 3000, 4);
// Store the class for the player (pilot)
PlayerInfo[playerid][PlayerTeam] = ClassPilot;
}
case 11, 12, 13: // Classes that will be police
{
// Display the name of the class
GameTextForPlayer(playerid, "Police officer", 3000, 4);
// Store the class for the player (police)
PlayerInfo[playerid][PlayerTeam] = ClassPolice;
}
case 14, 15, 16: // Classes that will be mafia
{
// Display the name of the class
GameTextForPlayer(playerid, "Mafia", 3000, 4);
// Store the class for the player (mafia)
PlayerInfo[playerid][PlayerTeam] = ClassMafia;
}
case 17, 18: // Classes that will be courier
{
// Display the name of the class
GameTextForPlayer(playerid, "PizzaBoy", 3000, 4);
// Store the class for the player (courier)
PlayerInfo[playerid][PlayerTeam] = ClassPizzaBoy;
}
case 19: // Classes that will be assistance
{
// Display the name of the class
GameTextForPlayer(playerid, "Assistance", 3000, 4);
// Store the class for the player (assistance)
PlayerInfo[playerid][PlayerTeam] = ClassAssistance;
}
case 20, 21, 22: // Classes that will be roadworker
{
// Display the name of the class
GameTextForPlayer(playerid, "RoadWorker", 3000, 4);
// Store the class for the player (roadworker)
PlayerInfo[playerid][PlayerTeam] = ClassRoadWorker;
}
}
return 1;
}
public OnPlayerConnect(playerid)
{
GameTextForPlayer(playerid,"Welcome to Unlimited Trucking", 3000, 4);
return 1;
}
enum TSpawnLocation
{
Float:SpawnX,
Float:SpawnY,
Float:SpawnZ,
Float:SpawnAngle
}
// Setup spawnlocations for each class (when selecting "Spawn" at class-selection, a random spawnlocation is selected)
new ASpawnLocationsTrucker[][TSpawnLocation] =
{
{-525.0, -502.0, 26.0, 0.0}, // Fallen Tree Depot
{-74.7, -1137.5, 4.5, 0.0}, // Flint Trucking Depot
{1457.0, 975.5, 11.0, 0.0}, // LVA Freight Depot
{-2136.0, -247.5, 36.5, 270.0}, // Doherty Depot
{1766.5, -2040.7, 14.0, 270.0}, // El Corona Depot
{-546.0, 2594.0, 54.0, 270.0}, // Las Payasdas Depot
{332.0, 900.0, 25.0, 205.0}, // Quarry Top
{-1575.0, -2724.0, 49.0, 146.0} // Shady Creek Depot
};
new ASpawnLocationsBusDriver[][TSpawnLocation] =
{
{1809.0, -1905.0, 13.6, 90.0}, // Los Santos busdepot
{-1983.0, 110.0, 27.7, 180.0}, // San Fierro busdepot
{1060.0, 1260.0, 11.0, 270.0} // Las Venturas busdepot
};
new ASpawnLocationsPilot[][TSpawnLocation] =
{
{2010.0, -2345.0, 13.6, 90.0}, // Los Santos airport
{-1211.0, -105.0, 14.2, 135.0}, // San Fierro airport
{1584.5343,1525.9928,10.8322,34.3635} // Las Venturas airport
};
new ASpawnLocationsPolice[][TSpawnLocation] =
{
{1568.5, -1693.5, 6.0, 180.0}, // Los Santos police station
{-1590.0, 716.25, -5.0, 270.0}, // San Fierro police station
{2275.0, 2460.0, 10.9, 90.0} // Las Venturas police station
};
new ASpawnLocationsMafia[][TSpawnLocation] =
{
{2822.5, 898.5, 10.8, 0.0} // Mafia hideout
};
new ASpawnLocationsPizzaBoy[][TSpawnLocation] =
{
{798.0, -618.75, 16.4, 0.0}, // Los Santos
{-1849.25, -135.0, 12.0, 90.0}, // San Fierro
{1050.5, 1931.0, 10.9, 270.0} // Las Venturas
};
new ASpawnLocationsAssistance[][TSpawnLocation] =
{
{211.25, 24.75, 2.6, 270.0}
};
new ASpawnLocationsRoadWorker[][TSpawnLocation] =
{
{-1866.25, -1715.25, 22.7, 125.0} // Junkyard
};







public OnPlayerRequestSpawn(playerid)
{
new Name[24], Msg[128],Index,Float:x, Float:y, Float:z, Float:Angle;
GetPlayerName(playerid, Name, sizeof(Name));
switch (PlayerInfo[playerid][PlayerTeam])
{
case ClassTruckDriver:
{
Index = random(sizeof(ASpawnLocationsTrucker)); // Get a random array-index to chose a random spawnlocation
x = ASpawnLocationsTrucker[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsTrucker[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsTrucker[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsTrucker[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid),x, y, z, Angle, 0, 0, 0, 0, 0, 0);

format(Msg, 128, "{00FF00}Player {FFFF00}%s{00FF00} joined {FFFF00}Trucker class", Name);
}
case ClassBusDriver:
{
Index = random(sizeof(ASpawnLocationsBusDriver));
x = ASpawnLocationsBusDriver[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsBusDriver[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsBusDriver[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsBusDriver[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid),x, y, z, Angle, 0, 0, 0, 0, 0, 0);
format(Msg, 128, "{00FF00}Player {FFFF00}%s{00FF00} joined {FFFF00}Busdriver class", Name);
}
case ClassPilot:
{
Index = random(sizeof(ASpawnLocationsPilot));
x = ASpawnLocationsPilot[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsPilot[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsPilot[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsPilot[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation

format(Msg, 128, "{00FF00}Player {FFFF00}%s{00FF00} joined {FFFF00}Pilot class", Name);
}
case ClassPolice:
{

Index = random(sizeof(ASpawnLocationsPolice));
x = ASpawnLocationsPolice[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsPolice[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsPolice[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsPolice[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid),x, y, z, Angle, 0, 0, 0, 0, 0, 0);
format(Msg, 128, "{00FF00}Player {FFFF00}%s{00FF00} joined {FFFF00}Police class", Name);
}
case ClassMafia:
{
Index = random(sizeof(ASpawnLocationsMafia));
x = ASpawnLocationsMafia[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsMafia[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsMafia[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsMafia[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid),x, y, z, Angle, 0, 0, 0, 0, 0, 0);
format(Msg, 128, "{00FF00}Player {FFFF00}%s{00FF00} joined {FFFF00}Mafia class", Name);
}
case ClassPizzaBoy:
{
Index = random(sizeof(ASpawnLocationsPizzaBoy));
x = ASpawnLocationsPizzaBoy[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsPizzaBoy[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsPizzaBoy[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsPizzaBoy[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid),x, y, z, Angle, 0, 0, 0, 0, 0, 0);
format(Msg, 128, "{00FF00}Player {FFFF00}%s{00FF00} joined {FFFF00}PizzaBoy class", Name);
}
case ClassAssistance:
{
Index = random(sizeof(ASpawnLocationsAssistance));
x = ASpawnLocationsAssistance[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsAssistance[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsAssistance[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsAssistance[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid),x, y, z, Angle, 0, 0, 0, 0, 0, 0);
format(Msg, 128, "{00FF00}Player {FFFF00}%s{00FF00} joined {FFFF00}Assistance class", Name);
}
case ClassRoadWorker:
{
Index = random(sizeof(ASpawnLocationsRoadWorker));
x = ASpawnLocationsRoadWorker[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsRoadWorker[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsRoadWorker[Index][SpawnZ]; // Get the Z-position for the spawnlocation
SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid),x, y, z, Angle, 0, 0, 0, 0, 0, 0);
Angle = ASpawnLocationsRoadWorker[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
format(Msg, 128, "{00FF00}Player {FFFF00}%s{00FF00} joined {FFFF00}Roadworker class", Name);
}
}

SendClientMessageToAll(0xFFFFFFFF, Msg);
return 1;
}
Reply
#2

Here is the problem (MAYBE)

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{

SetPlayerInterior(playerid,14); //Here, you are set the interior to ID 14, if you are not in any interior, you may set it to 0
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);
}
Reply
#3

Thanks it works you are cool +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)