New problem, read inside.
#1

I wanted to create a command /ramp, which would be for admins that could create a ramp lets say 5 feet infront of them. I found a stock that could help me, but I don't exactly know how to implent it. I was hoping one of you elite scripters could help me. The stock:

Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
	new Float:a;
	GetPlayerPos(playerid, x, y, a);
	GetPlayerFacingAngle(playerid, a);
	if (GetPlayerVehicleID(playerid))
	{
	  GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
	}
	x += (distance * floatsin(-a, degrees));
	y += (distance * floatcos(-a, degrees));
}
And I TRIED to implent it.. but I know I failed badly.. please help? Command I tried:
pawn Код:
if (strcmp(cmd, "/ramp", true) == 0)
    {
    if(IsPlayerConnected(playerid))
      {
        if(PlayerInfo[playerid][pAdmin] < 1337)
        {
      new Float:x, Float:y, FLoat:z;
      GetPlayerPos(playerid, x, y, z);
      GetXYInFrontOfPlayer(playerid, x, y, 5.0);
      CreateObject(1655, x, y, z);
                return 1;
            }
        }
    }
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)