SA-MP Forums Archive
can help - 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: can help (/showthread.php?tid=380802)



can help - adelmika - 27.09.2012

ineed some one tell me how to change bank area in Server Rp

it's the nourmal bank ineed to change it or make a /enter cmd idon't know how so can some one help


Re: can help - XtremeR - 27.09.2012

pawn Код:
if(!strcmp("/enter",cmdtext))
{
    if(IsPlayerInRangeOfPoint(playerid, 7.0, X,Y,Z))//checking that if the player is in range
    {
        SetPlayerPos(playerid,X,Y,Z);//setting player's pos..
    }
    return 1;
}



Re: can help - Jarnu - 27.09.2012

Banks are interiors so thats of course that you gotta

SetPlayerInterior when he enters.. and You need to SetPlayerInterior to normal .. ('0') when player get spawned or he dies or it might cause many bugs..
and
@Xtremer.. you just told him to set player pos when player is near bank or something .. but it will create bugs for him as bank is an interior and you just setting position.. not interior.

@adelmika get Interior ids here: http://weedarr.wikidot.com/interior


Re: can help - Lordzy - 27.09.2012

You can try like thiS
pawn Код:
CMD:enter(playerid,params[])
{
   new bint;
   bint = GetPlayerInterior(playerid);
   if(bint == 0) //0 is the interior id of bank.
   {
     //Function here.
   }
   else
   {
     SendClientMessage(playerid, 0xFF0000, "You need to be in a bank to use this command.");
   }
   return 1;
}



Re: can help - adelmika - 27.09.2012

itryed to change it but got errors so can someone help me and do it here


PHP код:
//By Mika Adel/Mode. Mika Adel
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ORANGE 0xFFA500AA
#define COLOR_GREY 0xAFAFAFAA
new robbing[MAX_PLAYERS];
new 
alreadyrobbed[MAX_PLAYERS];
enum pInfo
{
    
pCash
};
new 
PlayerInfo[MAX_PLAYERS][pInfo];
COMMAND:robban(playeridparams[])
{
    if(
IsPlayerConnected(playerid))
    {
        if(
robbing[playerid] == 1)
        {
            
SendClientMessage(playeridCOLOR_GREY" You are already robbing the bank, please slow down");
            return 
1;
        }
        if(
alreadyrobbed[playerid] == 1)
        {
            
SendClientMessage(playeridCOLOR_WHITE"You already robbed the bank! Wait 1 hour.");
            return 
1;
        }
        if(!
IsPlayerInRangeOfPoint(playerid5.02308.8071,-13.2485,26.7422)) // Change X Y Z to the location you want
        
{
            
SendClientMessage(playeridCOLOR_GREY" You are not at the bank !");
            return 
1;
        }
        
SendClientMessage(playeridCOLOR_WHITE" You started to rob the bank, This will take 10 minutes");
        
SetTimerEx("bankrob"600000false"i"playerid);
        
robbing[playerid] = 1;
        
SendClientMessageToAll(COLOR_ORANGE"||----------Latest News----------||");
        
SendClientMessageToAll(COLOR_WHITE" The bank is currently getting robbed.");
        
SendClientMessageToAll(COLOR_WHITE" We are currently waiting for the cops");
        
SendClientMessageToAll(COLOR_WHITE" We will report more when we get more information");
        
SendClientMessageToAll(COLOR_ORANGE"||----------Latest News----------||");
        return 
1;
    }
    return 
1;
}
forward bankrob(playerid);
public 
bankrob(playerid)
{
    
SendClientMessage(playeridCOLOR_WHITE" Your finished robbing the bank, Run now");
    
GivePlayerMoney(playerid500000);
    
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+500000;
    
alreadyrobbed[playerid] = 1;
    
robbing[playerid] = 0;
    
SetTimerEx("robbedoff"3600000false"i"playerid);
    
SendClientMessageToAll(COLOR_ORANGE"||----------Latest News----------||");
    
SendClientMessageToAll(COLOR_WHITE" It looks like the bankrobber got the cash.");
    
SendClientMessageToAll(COLOR_WHITE" The cops is currently waiting outside.");
    
SendClientMessageToAll(COLOR_ORANGE"||----------Latest News----------||");
    return 
1;
}
forward robbedoff(playerid);
public 
robbedoff(playerid)
{
    
alreadyrobbed[playerid] = 0;
    
SendClientMessage(playeridCOLOR_WHITE" You can now rob the bank again");
    return 
1;




Re: can help - .v - 27.09.2012

Quote:
Originally Posted by adelmika
Посмотреть сообщение
itryed to change it but got errors so can someone help me and do it here


PHP код:
//By Mika Adel/Mode. Mika Adel
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ORANGE 0xFFA500AA
#define COLOR_GREY 0xAFAFAFAA
new robbing[MAX_PLAYERS];
new 
alreadyrobbed[MAX_PLAYERS];
enum pInfo
{
    
pCash
};
new 
PlayerInfo[MAX_PLAYERS][pInfo];
COMMAND:robban(playeridparams[])
{
    if(
IsPlayerConnected(playerid))
    {
        if(
robbing[playerid] == 1)
        {
            
SendClientMessage(playeridCOLOR_GREY" You are already robbing the bank, please slow down");
            return 
1;
        }
        if(
alreadyrobbed[playerid] == 1)
        {
            
SendClientMessage(playeridCOLOR_WHITE"You already robbed the bank! Wait 1 hour.");
            return 
1;
        }
        if(!
IsPlayerInRangeOfPoint(playerid5.02308.8071,-13.2485,26.7422)) // Change X Y Z to the location you want
        
{
            
SendClientMessage(playeridCOLOR_GREY" You are not at the bank !");
            return 
1;
        }
        
SendClientMessage(playeridCOLOR_WHITE" You started to rob the bank, This will take 10 minutes");
        
SetTimerEx("bankrob"600000false"i"playerid);
        
robbing[playerid] = 1;
        
SendClientMessageToAll(COLOR_ORANGE"||----------Latest News----------||");
        
SendClientMessageToAll(COLOR_WHITE" The bank is currently getting robbed.");
        
SendClientMessageToAll(COLOR_WHITE" We are currently waiting for the cops");
        
SendClientMessageToAll(COLOR_WHITE" We will report more when we get more information");
        
SendClientMessageToAll(COLOR_ORANGE"||----------Latest News----------||");
        return 
1;
    }
    return 
1;
}
forward bankrob(playerid);
public 
bankrob(playerid)
{
    
SendClientMessage(playeridCOLOR_WHITE" Your finished robbing the bank, Run now");
    
GivePlayerMoney(playerid500000);
    
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+500000;
    
alreadyrobbed[playerid] = 1;
    
robbing[playerid] = 0;
    
SetTimerEx("robbedoff"3600000false"i"playerid);
    
SendClientMessageToAll(COLOR_ORANGE"||----------Latest News----------||");
    
SendClientMessageToAll(COLOR_WHITE" It looks like the bankrobber got the cash.");
    
SendClientMessageToAll(COLOR_WHITE" The cops is currently waiting outside.");
    
SendClientMessageToAll(COLOR_ORANGE"||----------Latest News----------||");
    return 
1;
}
forward robbedoff(playerid);
public 
robbedoff(playerid)
{
    
alreadyrobbed[playerid] = 0;
    
SendClientMessage(playeridCOLOR_WHITE" You can now rob the bank again");
    return 
1;

pawn Код:
//By Mika Adel/Mode. Mika Adel
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>

#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ORANGE 0xFFA500AA
#define COLOR_GREY 0xAFAFAFAA

new robbing[MAX_PLAYERS];
new alreadyrobbed[MAX_PLAYERS];

enum pInfo
{
    pCash
};

new PlayerInfo[MAX_PLAYERS][pInfo];

COMMAND:robban(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        if(robbing[playerid] == 1)
        {
            SendClientMessage(playerid, COLOR_GREY, " You are already robbing the bank, please slow down");
            return 1;
        }
        if(alreadyrobbed[playerid] == 1)
        {
            SendClientMessage(playerid, COLOR_WHITE, "You already robbed the bank! Wait 1 hour.");
            return 1;
        }
        if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2308.8071,-13.2485,26.7422)) // Change X Y Z to the location you want
        {
            SendClientMessage(playerid, COLOR_GREY, " You are not at the bank !");
            return 1;
        }
        SendClientMessage(playerid, COLOR_WHITE, " You started to rob the bank, This will take 10 minutes");
        SetTimerEx("bankrob", 600000, false, "i", playerid);
        robbing[playerid] = 1;
        SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");
        SendClientMessageToAll(COLOR_WHITE, " The bank is currently getting robbed.");
        SendClientMessageToAll(COLOR_WHITE, " We are currently waiting for the cops");
        SendClientMessageToAll(COLOR_WHITE, " We will report more when we get more information");
        SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");
        return 1;
    }
    return 1;
}


forward bankrob(playerid);
public bankrob(playerid)
{
    SendClientMessage(playerid, COLOR_WHITE, " Your finished robbing the bank, Run now");
    GivePlayerMoney(playerid, 500000);
    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+500000;
    alreadyrobbed[playerid] = 1;
    robbing[playerid] = 0;
    SetTimerEx("robbedoff", 3600000, false, "i", playerid);
    SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");
    SendClientMessageToAll(COLOR_WHITE, " It looks like the bankrobber got the cash.");
    SendClientMessageToAll(COLOR_WHITE, " The cops is currently waiting outside.");
    SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");
    return 1;
}

forward robbedoff(playerid);
public robbedoff(playerid)
{
    alreadyrobbed[playerid] = 0;
    SendClientMessage(playerid, COLOR_WHITE, " You can now rob the bank again");
    return 1;
}

CMD:enter(playerid,params[])
{
   new bint;
   bint = GetPlayerInterior(playerid);
   if(bint == 0) //0 is the interior id of bank.
   {
     SetPlayerPos(playerid, X.X,Y.Y,Z.Z); // You must get the bank postion inside first (Near the bank Entrance door)
     SetPlayerInterior(playerid, 0);
     SetPlayerVirtualWorld(playerid, 0);
     SetCameraBehindPlayer(playerid);
     DestroyVehicle(GetPlayerVehicleID(playerid)); //Just incase you used /enter with a vehicle
   }
   else
   {
     SendClientMessage(playerid, 0xFF0000, "You need to be in a bank to use this command.");
   }
   return 1;
}



Re: can help - adelmika - 27.09.2012

Quote:
Originally Posted by .v
Посмотреть сообщение
pawn Код:
//By Mika Adel/Mode. Mika Adel
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>

#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ORANGE 0xFFA500AA
#define COLOR_GREY 0xAFAFAFAA

new robbing[MAX_PLAYERS];
new alreadyrobbed[MAX_PLAYERS];

enum pInfo
{
    pCash
};

new PlayerInfo[MAX_PLAYERS][pInfo];

COMMAND:robban(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        if(robbing[playerid] == 1)
        {
            SendClientMessage(playerid, COLOR_GREY, " You are already robbing the bank, please slow down");
            return 1;
        }
        if(alreadyrobbed[playerid] == 1)
        {
            SendClientMessage(playerid, COLOR_WHITE, "You already robbed the bank! Wait 1 hour.");
            return 1;
        }
        if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2308.8071,-13.2485,26.7422)) // Change X Y Z to the location you want
        {
            SendClientMessage(playerid, COLOR_GREY, " You are not at the bank !");
            return 1;
        }
        SendClientMessage(playerid, COLOR_WHITE, " You started to rob the bank, This will take 10 minutes");
        SetTimerEx("bankrob", 600000, false, "i", playerid);
        robbing[playerid] = 1;
        SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");
        SendClientMessageToAll(COLOR_WHITE, " The bank is currently getting robbed.");
        SendClientMessageToAll(COLOR_WHITE, " We are currently waiting for the cops");
        SendClientMessageToAll(COLOR_WHITE, " We will report more when we get more information");
        SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");
        return 1;
    }
    return 1;
}


forward bankrob(playerid);
public bankrob(playerid)
{
    SendClientMessage(playerid, COLOR_WHITE, " Your finished robbing the bank, Run now");
    GivePlayerMoney(playerid, 500000);
    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+500000;
    alreadyrobbed[playerid] = 1;
    robbing[playerid] = 0;
    SetTimerEx("robbedoff", 3600000, false, "i", playerid);
    SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");
    SendClientMessageToAll(COLOR_WHITE, " It looks like the bankrobber got the cash.");
    SendClientMessageToAll(COLOR_WHITE, " The cops is currently waiting outside.");
    SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");
    return 1;
}

forward robbedoff(playerid);
public robbedoff(playerid)
{
    alreadyrobbed[playerid] = 0;
    SendClientMessage(playerid, COLOR_WHITE, " You can now rob the bank again");
    return 1;
}

CMD:enter(playerid,params[])
{
   new bint;
   bint = GetPlayerInterior(playerid);
   if(bint == 0) //0 is the interior id of bank.
   {
     SetPlayerPos(playerid, X.X,Y.Y,Z.Z); // You must get the bank postion inside first (Near the bank Entrance door)
     SetPlayerInterior(playerid, 0);
     SetPlayerVirtualWorld(playerid, 0);
     SetCameraBehindPlayer(playerid);
     DestroyVehicle(GetPlayerVehicleID(playerid)); //Just incase you used /enter with a vehicle
   }
   else
   {
     SendClientMessage(playerid, 0xFF0000, "You need to be in a bank to use this command.");
   }
   return 1;
}
igot errors
Quote:

D:\Sa-mp test server\filterscripts\robbanksystem.pwn(85) : error 017: undefined symbol "X"
D:\Sa-mp test server\filterscripts\robbanksystem.pwn(85) : error 029: invalid expression, assumed zero
D:\Sa-mp test server\filterscripts\robbanksystem.pwn(85) : error 017: undefined symbol "X"
D:\Sa-mp test server\filterscripts\robbanksystem.pwn(85) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.




Re: can help - adelmika - 27.09.2012

can someone help