Hello There, Guest! Login or Register


It's to much
#1
:) Hello!
Ok my scripting has come to the point where I no longer can see the difference between right and left.

This is one(many)  question about the interiors and the linking between pickups and textdraw and all that.
I've read some in the unofficial sa-mp forum. But it's all a big mesz.

Lets say I want to add a new enterable house, in this house I want to be able to use. /bank /balance /withdraw.
So in the script I then add the following in my script?
Quote:#define SanFierroBank 1272, 2, -1753.9858, 962.8443, 24.8828, 5.4363,0);
//---------------------------
new SanFierroBank
//---------------------------
AddStaticPickup( 1272, 2, -1753.9858, 962.8443, 24.8828, 5.4363,0); //  Bank
//---------------------------
enum pInfo
{
pBankCash,
};
//---------------------------
public InfoTextDraw(playerid, string[], time)
{
return 1;
}
//---------------------------
public OnPlayerPickUpPickup(playerid, pickupid)
{
new string[256];
if(pickupid == SanFierroBank)
{
if(gTeam[playerid] == TEAM_Blahc)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, " '/Enter' To enter the San Fierro Bank");

return 1;
}

//-----------------------------

public OnPlayerCommandText[playerid, cmdtext[])
{

new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
new tmp[256];
new playername[MAX_PLAYER_NAME];
new Float:slapx, Float:slapy Float:slapz;
if (strcmp(cmdtext, "/kill", true) == 0)
{
SetPlayerHealth(playerid, 0);
GivePlayerMoney(playerid, -0);

return 1;
}
//----------------------


Okay so that is what I have and I'm now going to add the scripts I found on the unofficial sa-mp forum

Quote:/*
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext,"/island", true))
      {
            new pname[255];
            GetPlayerName(playerid, pname, sizeof(pname));
            format(pname, sizeof(pname), "Welcome to the Island %s!",pname);
            SetPlayerPos(playerid,3880.079345,-1355.733276,8.106499);
            return 1;
      }
return 0;
}

if(strcmp(cmd,"/bank",true) == 0)
{
SetPlayerPos(playerid, 2305.688964,-16.088100,26.749599);
SendClientMessage(playerid, 0xFFAAAA, "* Welcome to the bank!");
new Bankused[MAX_PLAYERS];
Bankused = 1;
return 1; }

and for the transfer stuff try just after the opening brace( " { " )
if(Bankused[playerid] == 1)
// Content here
}
} else {
SendClientMessage(playerid, 0xFFAAAA, "* Not at bank(/bank)");
}
return 1;
}


//At the top:
new PlayerArea[MAX_PLAYERS];
forward IsPlayerInArea(playerid, Float:maxx, Float:maxy, Float:maxz, Float:minx, Float:miny, Float:minz);

//In OnGameModeInit:
SetTimer("SomeTimer",500,1);

//Outside the functions
public SomeTimer(){
for(new i;i<MAX_PLAYERS;i++){
if(IsPlayerInArea(i,maxx,maxy,maxz,minx,miny,minz)){ //Area in front of interior 1
PlayerArea[i] = 1;
SetPlayerVirtualWorld(i,0);
}else if(IsPlayerInArea(i,maxx,maxy,maxz,minx,miny,minz)){ //Area in front of interior 2
PlayerArea[i] = 2;
SetPlayerVirtualWorld(i,0);
}else if(IsPlayerInArea(i,maxx,maxy,maxz,minx,miny,minz)){ //Area in front of interior 3
PlayerArea[i] = 3;
SetPlayerVirtualWorld(i,0);
}
if(IsPlayerInArea(i,maxx,maxy,maxz,minx,miny,minz)){ //Area of interior 1
SetPlayerVirtualWorld(i,PlayerArea[i]);
}else if(IsPlayerInArea(i,maxx,maxy,maxz,minx,miny,minz)){ //Area of interior 2
SetPlayerVirtualWorld(i,PlayerArea[i]);
}else if(IsPlayerInArea(i,maxx,maxy,maxz,minx,miny,minz)){ //Area of interior 2
SetPlayerVirtualWorld(i,PlayerArea[i]);
}
}
}


//Outside the functions
public IsPlayerInArea(playerid, Float:maxx, Float:maxy, Float:maxz, Float:minx, Float:miny, Float:minz)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(x < maxx && y < maxy && z < maxz && x > minx && y > miny && z > minz) return 1;
return 0;
}

Can someone please, please, tell me what is what here, I find these lines all messed up, and also how I can link/how to script:
enter a virtual world.
Lets say, If I now pick up the bank icon I mentioned at the top, I get a message "type '/enter' to enter the bank"
And when the player types /enter, he will be teleported, into the bank interior.

I know this is much, and messy text. can be hard to read.. but I'm in a hurry right now, I might be able to correct this later.

what I'm asking for:
How can I make a functional bank inside an interior.
How I can link the pickup to an virtual world where the virtualworld would be the bank interior ID.

Why am I asking. Because the Official forum is down, the UnOfficial forum is just all a big mess and the wiki is to short and I can't realy understand it.
I you know anything about pickups and virtualworlds please answer to this, I'm getting desperate.

PS. Thank you for taking your time. :z

:Y)


Reply
#2
ok, (sorry for dubble post but I think this needs it)

Quote:    //--------------------------------------- 1 -2158.72 641.29 1052.38
if(strcmp(cmdtext,"/home", true)==0)
{
SetPlayerInterior(playerid, 1);
SetPlayerPos(playerid,-2158.72, 641.29,1052.38);
    GivePlayerMoney(playerid, -5000);
    SendClientMessage(playerid,COLOR_ORANGE,"Welcome!");
return 1;
}
    //---------------------------------------

Quote: AddStaticPickup( 1273, 2, -2155.7454, 645.5275, 52.3672); //  Woozie's beting shop

How do I link these two togheter now?
should it be with a "new Woozie"
and then ... a f*it I don't know please help me.

:w


EDIT:

Woohoo I managed to get into the old sa-mp forum (or at leats thats what the forum name was... sa-mp forum)And I've found some good scripting references and other stuff, I'm going to read a bit, and maybe I won't need any help :w.
Reply