#1

I have some maps which i want to play on,but because of this I am unable to...

PHP код:
public OnPlayerSpawn(playerid)
{
        if(
MAP == 0// Default map(RC Battlefield)
        
{
                
SetPlayerInterior(playerid,10);
        }
        else if(
MAP == 1// Jefferson Motel
        
{
            
SetPlayerInterior(playerid,15);
            if(
GetPlayerTeam(playerid) == 1)
            {
                
SetPlayerPos(playerid,2217.5869,-1151.1071,1025.7969);
                
SetPlayerFacingAngle(playerid,272.2993);
            }
            else if(
GetPlayerTeam(playerid) == 2)
            {
                
SetPlayerPos(playerid,2195.3025,-1143.9893,1029.7969);
                
SetPlayerFacingAngle(playerid,181.1184);
                }
        }
        else if(
MAP == 2//Liberty City
        
{
                
SetPlayerInterior(playerid,1);
            if(
GetPlayerTeam(playerid) == 1)
            {
                
SetPlayerPos(playerid,-795.0522,495.1387,1376.1953);
                
SetPlayerFacingAngle(playerid,356.2731);
            }
            else if(
GetPlayerTeam(playerid) == 2)
            {
                
SetPlayerPos(playerid,-830.9671,515.4208,1357.6854);
                
SetPlayerFacingAngle(playerid,182.6851);
                }
        }
        else if(
MAP == 3//Pleasure Domes
        
{
            
SetPlayerInterior(playerid,3);
            if(
GetPlayerTeam(playerid) == 1)
            {
                
SetPlayerPos(playerid,-2647.0217,1423.9025,906.4609);
                
SetPlayerFacingAngle(playerid,127.1440);
            }
            else if(
GetPlayerTeam(playerid) == 2)
            {
                
SetPlayerPos(playerid,-2667.2332,1426.8282,906.4609);
                
SetPlayerFacingAngle(playerid,179.7845);
                }
        }
        else if(
MAP == 4// Planning Department
        
{
                
SetPlayerInterior(playerid,3);
            if(
GetPlayerTeam(playerid) == 1)
            {
                
SetPlayerPos(playerid,349.0134,163.6172,1025.7891);
                
SetPlayerFacingAngle(playerid,271.4312);
            }
            else if(
GetPlayerTeam(playerid) == 2)
            {
                
SetPlayerPos(playerid,-372.1458,180.4995,1008.3828);
                
SetPlayerFacingAngle(playerid,179.8669);
                }
        }
        
SetPlayerHP(playerid,100.0);
        
SPAWNED[playerid] = 1;
        return 
1;

How can I change it to load the map file in Filterscripts?
Reply
#2

Quote:
Originally Posted by ProBro
Посмотреть сообщение
I have some maps which i want to play on,but because of this I am unable to...

PHP код:
public OnPlayerSpawn(playerid)
{
        if(
MAP == 0// Default map(RC Battlefield)
        
{
                
SetPlayerInterior(playerid,10);
        }
        else if(
MAP == 1// Jefferson Motel
        
{
            
SetPlayerInterior(playerid,15);
            if(
GetPlayerTeam(playerid) == 1)
            {
                
SetPlayerPos(playerid,2217.5869,-1151.1071,1025.7969);
                
SetPlayerFacingAngle(playerid,272.2993);
            }
            else if(
GetPlayerTeam(playerid) == 2)
            {
                
SetPlayerPos(playerid,2195.3025,-1143.9893,1029.7969);
                
SetPlayerFacingAngle(playerid,181.1184);
                }
        }
        else if(
MAP == 2//Liberty City
        
{
                
SetPlayerInterior(playerid,1);
            if(
GetPlayerTeam(playerid) == 1)
            {
                
SetPlayerPos(playerid,-795.0522,495.1387,1376.1953);
                
SetPlayerFacingAngle(playerid,356.2731);
            }
            else if(
GetPlayerTeam(playerid) == 2)
            {
                
SetPlayerPos(playerid,-830.9671,515.4208,1357.6854);
                
SetPlayerFacingAngle(playerid,182.6851);
                }
        }
        else if(
MAP == 3//Pleasure Domes
        
{
            
SetPlayerInterior(playerid,3);
            if(
GetPlayerTeam(playerid) == 1)
            {
                
SetPlayerPos(playerid,-2647.0217,1423.9025,906.4609);
                
SetPlayerFacingAngle(playerid,127.1440);
            }
            else if(
GetPlayerTeam(playerid) == 2)
            {
                
SetPlayerPos(playerid,-2667.2332,1426.8282,906.4609);
                
SetPlayerFacingAngle(playerid,179.7845);
                }
        }
        else if(
MAP == 4// Planning Department
        
{
                
SetPlayerInterior(playerid,3);
            if(
GetPlayerTeam(playerid) == 1)
            {
                
SetPlayerPos(playerid,349.0134,163.6172,1025.7891);
                
SetPlayerFacingAngle(playerid,271.4312);
            }
            else if(
GetPlayerTeam(playerid) == 2)
            {
                
SetPlayerPos(playerid,-372.1458,180.4995,1008.3828);
                
SetPlayerFacingAngle(playerid,179.8669);
                }
        }
        
SetPlayerHP(playerid,100.0);
        
SPAWNED[playerid] = 1;
        return 
1;

How can I change it to load the map file in Filterscripts?
I can't really understand what's the problem by that code
Reply
#3

You can find the answer in your heart.















Or you can explain your problem properly so we can help you.
Reply
#4

Quote:
Originally Posted by Flamehaze7
Посмотреть сообщение
I can't really understand what's the problem by that code
No Problem,I want to remove Interiors and make it to load maps from filterscripts,any idea how?
Reply
#5

Quote:
Originally Posted by ProBro
Посмотреть сообщение
No Problem,I want to remove Interiors and make it to load maps from filterscripts,any idea how?
Just add the objects to a filterscript and then remove the 'SetPlayerInterior' on your main code.
Reply
#6

Quote:
Originally Posted by Flamehaze7
Посмотреть сообщение
Just add the objects to a filterscript and then remove the 'SetPlayerInterior' on your main code.
just that? Nothing else? :v
Reply
#7

Dosen't works.
Reply
#8

What are you trying to do and how are you trying to do it? Your explanation is weird, you want to spawn at the location provided by the filterscript?

What is this filterscript you want to use?
Reply
#9

Quote:
Originally Posted by Troydere
Посмотреть сообщение
What are you trying to do and how are you trying to do it? Your explanation is weird, you want to spawn at the location provided by the filterscript?

What is this filterscript you want to use?
This filterscript is a map created in MTA and converted in samp format,I use format like kitten's Za one.

Like this
HumanSpawn [ X..Y..Z..]
AndroidSpawn[ X..Y..Z..]

Or if not,I just want to remove interiors and add maps,Self/Custom made.
Reply
#10

You could comment out all the functions under OnPlayerSpawn to see if it compiles that way, if so, then you can add your own spawn locations and so on.

Trace the variables used under OnPlayerSpawn and delete these functions so it wont be buggy afterwards.
Reply
#11

Quote:
Originally Posted by Troydere
View Post
You could comment out all the functions under OnPlayerSpawn to see if it compiles that way, if so, then you can add your own spawn locations and so on.


Trace the variables used under OnPlayerSpawn and delete these functions so it wont be buggy afterwards.
Like Flamehaze said,I did it,and it Compiled with no errors,but when I joined the server,I was supposed to be in some kind of third dimension Lol,Alright,I\'ll try that and tell.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)