How do i fix this command? -
Drift_04 - 23.03.2009
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]~~
Re: How do i fix this command? -
[HiC]TheKiller - 23.03.2009
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.
Re: How do i fix this command? -
Drift_04 - 23.03.2009
no ur wrong.
Re: How do i fix this command? -
MenaceX^ - 23.03.2009
pawn Код:
if(!strcmp(cmd,"/wall",true))
{
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);
return GivePlayerMoney(playerid,-20000);
}
In the first code, /wall doesn't have 10 cells.
Re: How do i fix this command? -
Dujma - 23.03.2009
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;
}
Re: How do i fix this command? -
MenaceX^ - 23.03.2009
Quote:
|
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; }
|
I just fixed the code. I didn't even read what he wants there..
Re: How do i fix this command? -
Dujma - 23.03.2009
Not that just. He said that to create an object in front of you, you need to increase the X axis by 2... lol
Re: How do i fix this command? -
Drift_04 - 23.03.2009
so wherewould i place that code in this??
in here:
Код:
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;
}
cuz if i was supposed to place it somewhere in my script it didnt work.
Re: How do i fix this command? -
Nero_3D - 23.03.2009
pawn Код:
if(!strcmp("/wall", cmdtext, true))
{
if(GetPlayerMoney(playerid) < 20000) return SendClientMessage(playerid, red, "You need $20,000$");
new Float:Pos[4];
GetPlayerFacingAngle(playerid, Pos[0]);
GetPlayerPos(playerid, Pos[1], Pos[2], Pos[3]);
Pos[1] += floatmul(5.0, floatsin(-Pos[0], degrees));
Pos[2] += floatmul(5.0, floatcos(-Pos[0], degrees));
CreateObject(974, Pos[1], Pos[2], Pos[3], 0, 0, 0);
GivePlayerMoney(playerid, -20000);
return 1;
}
Re: How do i fix this command? -
Drift_04 - 23.03.2009
it still doesnt appear in front of me.

, thanx or trying everyone.