Vice City Multiplayer

VC:MP => mIRC/pawn Scripting => Topic started by: goudewup on February 17, 2010, 02:32:51 PM

Title: [Pawn] Can't move when spawned?
Post by: goudewup on February 17, 2010, 02:32:51 PM
Hey all, i got some wierd problems with my server...
(i downloaded the package yesterday from vicecitymultiplayer.com, so i run the newest & pawn-using one)

When i spawn i can only move my camera and rotate, i can't walk or move forward in any way...

I think this code will do for now:


public OnPlayerSpawn(playerid,classid,teamid)
{
TogglePlayerControllable(playerid, 1);
return 1;
}


Did i forget something?
Title: Re: [Pawn] Can't move when spawned?
Post by: Boss on February 17, 2010, 02:38:08 PM
You don't need to use this toggle, since players are able to move after spawning by default.

The most probable problem is your controls. If you encounter that problem on all the servers, go to your options and reconfigure them.
Title: Re: [Pawn] Can't move when spawned?
Post by: -TriX- on February 17, 2010, 02:39:46 PM
Quote from: Boss on February 17, 2010, 02:38:08 PM
You don't need to use this toggle, since players are able to move after spawning by default.

The most probable problem is your controls. If you encounter that problem on all the servers, go to your options and reconfigure them.
Title: Re: [Pawn] Can't move when spawned?
Post by: goudewup on February 17, 2010, 02:47:22 PM
the wierd thing is that i only get it on my own server...

So now i removed the toggle and it still didn't move.
Then i looked at other scripts and saw that they had this code:

public OnPlayerConnect(playerid)
{
   SetWaterLevel(6.0);
SetGamespeed(100);
SetGravity(100);
return 1;
}


But when i add this to my server my character just starts jumping into one direction and i still can't control him..

Any suggestions?
Title: Re: [Pawn] Can't move when spawned?
Post by: Boss on February 17, 2010, 02:51:58 PM
These functions should be put in OnGameModeInit (since they should be set once rather than every time a player connects). I also suspect that they caused your gravity to be almost non-existent (resulting in endless jumps), so try removing these functions.

If nothing helps, rollback to the default mode (mode.pwn). It works 100%.
Title: Re: [Pawn] Can't move when spawned?
Post by: goudewup on February 17, 2010, 05:36:06 PM
I started with the default mode now, but i already got a problem waiting for you!  :-[

I have a command that is supposed to work like !v [vehicleid] and then it spawn the vehicle. But it doesn't work...


public OnPlayerText(playerid, cmdtext[])
{
new cmd[256], idx, tmp[256];
cmd = strtok(cmdtext, idx);

if(strcmp(cmd, "!v", true) == 0)
{
    new carid, car;
    tmp = strtok(cmdtext, idx);
    carid = strval(tmp);
    if(strlen(carid) == 0) return SendClientMessage(playerid, COLOR_RED, "USAGE: !v [vehicleid]");
    new Float:X, Float:Y, Float:Z, Float:A;
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, A);
    car = CreateVehicle(carid, X, Y, Z, A, 1, 1, 0);
    PutPlayerInVehicle(playerid, car);
    SendClientMessage(playerid, 0xFFFFFFFF, "A car has spawned for you!");
    return 0;
}
return 1;
}


Man, i'd never tought making a VC:MP server was hard for someone who can make a SA:MP RP  :-X
Title: Re: [Pawn] Can't move when spawned?
Post by: thijn on February 17, 2010, 08:25:19 PM
Just a note: the jumping can also be the result of not proper set world bounds.
Title: Re: [Pawn] Can't move when spawned?
Post by: goudewup on February 18, 2010, 07:43:31 PM
nowhere in my old script are any world boundaries...
Title: Re: [Pawn] Can't move when spawned?
Post by: thijn on February 18, 2010, 09:28:29 PM
thats why.