[FS] Air-Break Script Problem
#1

Hi! I'm trying to make a Air-Brake FilterScript for my server, running on SA-MP 0.3e, but I can't understand what I'm going wrong... Here is my code:

#include <a_samp>

new AirBrake[MAX_PLAYERS];
new AirObject;

forward funzioni1(playerid,AirObject);


public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/airbrake", cmdtext, true, 11) == 0)
{
if (AirBrake[playerid] == 0)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
AirObject = CreatePlayerObject(playerid,3115,X,Y,Z-1,0,0,0,0);
AirBrake[playerid] = 1;
MovePlayerObject(playerid,AirObject,X,Y,Z,16,0,0,0 );
SendClientMessage(playerid,0xFFFFFFFF,"{C0C0C0}AIR-BREAK: {FFFFFF}Attivato");
return 1;
}
if (AirBrake[playerid] == 1)
{
AirBrake[playerid] = 0;
DestroyPlayerObject(playerid,AirObject);
SendClientMessage(playerid,0xFFFFFFFF,"{C0C0C0}AIR-BREAK: {FFFFFF}Disattivato");
}
}
}


public funzioni1(playerid,AirObject)
{
if (AirBrake[playerid] == 1)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
MovePlayerObject(playerid,AirObject,X,Y,Z,16,0,0,0 );
}
}

The object places at player position when it spaws, but not update it position... Why?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)