|
Originally Posted by Dujma
Quote:
|
Originally Posted by [HiC
TheKiller ]
Quote:
|
Originally Posted by Drift_04
ok i made a command that spawns a wall next to you, but the wall is not in front of you here is the code
code:
Код:
if (strcmp("/wall", cmdtext, true, 10) == 0)
{
if(GetPlayerMoney(playerid) <= 20000) return SendClientMessage(playerid,red, "You need $20,000$");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateObject(974,x,y+2,z,0,0,0);
GivePlayerMoney(playerid,-20000);
return 1;
}
Could someone edit it so the wall appears in front of the player please? Thankyou!
~~[Drift]~~
|
pawn Код:
if (strcmp("/wall", cmdtext, true, 10) == 0) { if(GetPlayerMoney(playerid) <= 20000) return SendClientMessage(playerid,red, "You need $20,000$"); new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); CreateObject(974,x+2,y,z,0,0,0); GivePlayerMoney(playerid,-20000); return 1; }
+2 y axis will make it next to you. If you do +2 x axis it will go infront of you. Correct me if I'm wrong.
|
lol
Use this
pawn Код:
stock Float:GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance) { new Float:a; GetPlayerPos(playerid, x, y, a); if (IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a); else GetPlayerFacingAngle(playerid, a); x += (distance * floatsin(-a, degrees)); y += (distance * floatcos(-a, degrees)); return a; }
|