SA-MP Forums Archive
Interior Help - Gang Server - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Interior Help - Gang Server (/showthread.php?tid=388401)



Interior Help - Gang Server - nicholas1 - 28.10.2012

I am having trouble with integers.I just found out how to do it and stuff.
This is my interger
SetPlayerInterior(playerid, 15);
I also tried SetPlayerInterior(playerid, 15,2220.26,-1148.01,1025.80);
Because,I want to be spawn at Jefferson Motel.
I read this >>> https://sampwiki.blast.hk/wiki/InteriorIDs

But,where to place it.I want that interior to be the place where all players spawn.


Re: Interior Help - Gang Server - gtakillerIV - 28.10.2012

It should be:

PHP код:
SetPlayerInterior(playerid15);//Setting the player's Interior to 15 so the Motel can be visible.
SetPlayerPos(playerid2220.26, -1148.011025.80);// Teleporting the player to the Motel's pos. 
Remember to set his interior to 0 after your done.

FMJ


Re: Interior Help - Gang Server - nicholas1 - 28.10.2012

Thanks and where to put it at.I put it here

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
SetPlayerInterior(playerid, 15);//Setting the player's Interior to 15 so the Motel can be visible.
SetPlayerPos(playerid, 2220.26, -1148.01, 1025.80);// Teleporting the player to the Motel's pos.
return 1;
}


Re: Interior Help - Gang Server - gtakillerIV - 28.10.2012

Wrong man, you should put it inside of a command. For example:

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/tpme"cmdtexttrue5) == 0)
    {
        
SetPlayerInterior(playerid15);
        
SetPlayerPos(playerid2220.26, -1148.011025.80);
        
SendClientMessage(playerid, -1"Teleported!");
        return 
1;
    }
    return 
0;

EDIT:

Command for getting our of the Interior(15):

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/tpme"cmdtexttrue5) == 0)
    {
        
SetPlayerInterior(playerid15);//Setting the player's Interior to 15 so the Motel can be visible.
        
SetPlayerPos(playerid2220.26, -1148.011025.80);//Teleporting the player to the Motel's Pos.
        
SendClientMessage(playerid, -1"Teleported!");//Sending the player a message.
        
return 1;
    }
    if(
strcmp("/getmeout"cmdtexttrue9) == 0)
    {
        
SetPlayerInterior(playerid0);//Setting the player's Interior to 0(default one).
        
SetPlayerHealth(playerid0);//Setting the player's health to 0. Which will obviously kill him.
        
SendClientMessage(playerid, -1"Done..");//Sending him a message saying that the command did what it was ment to do :p..
        
return 1;
    }
    return 
0;




Re: Interior Help - Gang Server - nicholas1 - 28.10.2012

Thanks I did it
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/tpme", cmdtext, true, 5) == 0)
{
SetPlayerInterior(playerid, 15);
SetPlayerPos(playerid, 2220.26, -1148.01, 1025.80);
SendClientMessage(playerid, -1, "Teleported!");
return 1;
}
return 0;
}


Also,how do I add the /cmds and /kill function because I know how to do it.But,now when I add it I get errors and crap.So,can you show it too me better plz


Re: Interior Help - Gang Server - MarTaTa - 28.10.2012

If you want the players to spawn at Jefferson Motel when they connect to the server you need to put this at "OnPlayerSpawn", like this.
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid, 15);
    SetPlayerPos(playerid, 2220.26, -1148.01, 1025.80);
    return 1;
}
Or if you need it in a command, just follow what gtakillerIV said


Re: Interior Help - Gang Server - gtakillerIV - 28.10.2012

Put this command inside of the callback (OnPlayerCommandText):

PHP код:
if (strcmp("/kill"cmdtexttrue5) == 0)
    {
        
SetPlayerHealth(playerid0);//Setting the player's health to 0 which will kill him.
        
SendClientMessage(playerid, -1"You have committed suicide!");//Sending him a message.
        
return 1;
    } 
And for the /cmds command do you want it with a dialog or normal text?

Now your callback should look like this:

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/tpme"cmdtexttrue5) == 0)
    {
     
SetPlayerInterior(playerid15);
        
SetPlayerPos(playerid2220.26, -1148.011025.80);
        
SendClientMessage(playerid, -1"Teleported!");
        return 
1;
    }
    if(
strcmp("/getmeout"cmdtexttrue9) == 0)
    {
        
SetPlayerInterior(playerid0);
        
SetPlayerHealth(playerid0);
        
SendClientMessage(playerid,-1"Done...");
    }
    if (
strcmp("/kill"cmdtexttrue5) == 0)
    {
        
SetPlayerHealth(playerid0);//Setting the player's health to 0 which will kill him.
        
SendClientMessage(playerid, -1"You have committed suicide!");//Sending him a message.
        
return 1;
    }
    return 
0;




Re: Interior Help - Gang Server - nicholas1 - 28.10.2012

I did this
public OnPlayerSpawn(playerid)
{
SetPlayerInterior(playerid, 15);
SetPlayerPos(playerid, 2220.26, -1148.01, 1025.80);
return 1;
}

Because,I like it better using it as player Spawn
But,bad thing about it my ballas skin guy spawn correctly but my grove skin spawn difference angle but next to ballas guy help me fix it plz

AddPlayerClass(104,2217.3672,-1151.2461,1025.7969,272.5067,24,55,30,2500,0,0); // Ballas guy-104
AddPlayerClass(106,2195.8420,-1145.9053,1029.7969,92.6481,24,55,30,2500,0,0); // Grove guy - 106


Re: Interior Help - Gang Server - nicholas1 - 28.10.2012

Also GTAkiller yea from FMJ
Also,I did this 1 because I am not using it as a tp cmd.
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kill", cmdtext, true, 5) == 0)
{
SetPlayerHealth(playerid, 0);//Setting the player's health to 0 which will kill him.
SendClientMessage(playerid, -1, "You have committed suicide!");//Sending him a message.
return 1;
}
return 0;
}


I will also need to add a /ban cmd so can you add that command? Also,I need a kick but for this can you make it where if a regular player try it he cant.Because,I will need a admin system also.


Re: Interior Help - Gang Server - gtakillerIV - 28.10.2012

I really don't get it, but do you want them to spawn at diffrent areas?

EDIT:

Ok bro your requests are getting bigger so I will suggest you to move to Sscanf and ZCMD + YINI for making the user system so we can have Admin commands and so on.