Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: Synx on May 01, 2011, 07:55:04 pm

Title: SetPlayerWorldBounds...
Post by: Synx on May 01, 2011, 07:55:04 pm
I want make world bounds over army base to nobody can't leave.

I tryed from this http://famp.ru/wiki/SetWorldBounds still not understand.

[pawn]SetWorldBounds(1780.2505,1588.6793,-304.5052,-86.6157);[/pawn]

Help please.

P.S. Sorry for bad English.
Title: Re: SetPlayerWorldBounds...
Post by: stormeus on May 01, 2011, 08:22:15 pm
I want make world bounds over army base to nobody can't leave.

I tryed from this http://famp.ru/wiki/SetWorldBounds still not understand.

[pawn]SetWorldBounds(1780.2505,1588.6793,-304.5052,-86.6157);[/pawn]

Help please.

P.S. Sorry for bad English.

SetWorldBounds is bugged. You'll need to script a function that puts a player back in the army base when they try to leave.
Title: Re: SetPlayerWorldBounds...
Post by: BIG[H] on May 02, 2011, 04:53:14 am
I use Shadow Heekz One


Add These Two in Public's
Code: [Select]
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new Float:tempposx, Float:tempposy, Float:tempposz;
    GetPlayerPos(playerid, oldposx, oldposy, oldposz);
    tempposx = (oldposx -x);
    tempposy = (oldposy -y);
    tempposz = (oldposz -z);
    if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
    {
        return 1;
    }
    return 0;
}


and

Code: [Select]
public MapBounds()
{
for(new i = 0; i <= MAX_PLAYERS; i++) if(IsPlayerConnected(i) == 1) {
if(!PlayerToPoint(50,i,1780.2505,1588.6793,-304.5052,-86.6157)){
if(PlayerInfo[i][Spawned] == 1) {
SetPlayerPos(i,1780.2505,1588.6793,-304.5052,-86.6157,1.00,0);
 }
 }
}

At GameModeInit

Code: [Select]
SetTimer("MapBounds",15s00,0);
Title: Re: SetPlayerWorldBounds...
Post by: tato on May 02, 2011, 07:37:51 am
noooo!!! is not buged i used that i can give u the coordinates just from the military base???? ok i'll give u that one


just remplace the old one for that one
[pawn]SetWorldBounds(-1590.893,-1778.929,-90.53571,-306.4286);[/pawn]

it's working i already tried it