15.10.2009, 21:08
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:
And I TRIED to implent it.. but I know I failed badly.. please help? Command I tried:
Код:
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)); }
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;
}
}
}