AddPlayerClass Problem !
#1

Hi Guys,
I am having a problem with the AddPlayerClass. I have many these lines.

Код:
AddPlayerClass(0,404.0729,2464.5574,16.5000,356.6976,0,0,0,0,0,0); // aa
AddPlayerClass(0,-1353.3026,-235.7281,14.1440,315.7605,0,0,0,0,0,0); // SFA
AddPlayerClass(0,1319.9559,1269.4812,10.8203,0.2658,0,0,0,0,0,0); // lva
AddPlayerClass(0,-2329.2629,-1626.5853,483.7054,331.0678,0,0,0,0,0,0); // mc
AddPlayerClass(0,-302.0363,1525.2842,75.3594,358.8640,0,0,0,0,0,0); // drift 1
AddPlayerClass(0,1422.1212,-2541.3335,13.5469,270.1175,0,0,0,0,0,0); // lsa
But it reads only the first line and Spawns the player in Abondoned Airport only. Please!! Can anybody help ?
Reply
#2

You're placing these under OnGameModeInit? there is nothing wrong with your code, it should work just fine when class selection is triggered? Have you tried spawning, pressing F4, then dying again?
Reply
#3

OK... so you want to be a CJ and spawn in some random positons? If yes then follow my steps...

1. First we are going to make a variable! Just add this near the function OnGameModeInIt just like this:
PHP код:
new Float:Positions[][] =
{
    {
404.07292464.557416.5000356.6976},
    {-
1353.3026, -235.728114.1440315.7605},
    {
1319.95591269.481210.82030.2658},
    {-
2329.2629, -1626.5853483.7054331.0678},
    {-
302.03631525.284275.3594358.8640},
    {
1422.1212, -2541.333513.5469270.1175}
};
public 
OnGameModeInIt()
{
     
//Your code.

2. Now go to the function OnPlayerSpawn and add this:
PHP код:
public OnPlayerSpawn(playerid)
{
     new 
Random random(sizeof(Positions));
     
SetPlayerPos(playeridPositions[Random][0], Positions[Random][1],Positions[Random][2],Positions[Random][3]);
     
//Your other code...

And also ignore the warning! It doesn't affect anything! xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)