I need help with OnPlayerToPoint please -
*ToM* - 20.04.2009
Yo i got some fucking errors while compiling this little filterscript, all I want to know is how can I fix this shit ?
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;
if(!strcmp("/blah", cmdtext, true))
{
if(PlayerToPoint(2.0,1633.2205,-1019.4009,23.8984))
{
SendClientMessage(playerid, COLOR_YELLOW, "blah blah blah blah !");
GivePlayerWeapon(playerid,3,1);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1602.8052,-1009.7886,23.9063);
GameTextForPlayer(playerid,"~w~BLAH BLAH ~y~BLAH BLAH ",5000,5);
return 1;
}
return 0;
}
and I get these errors :
Код:
C:\Documents and Settings\Toniu\Desktop\YoMama.pwn(156) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Toniu\Desktop\YoMama.pwn(158) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Toniu\Desktop\YoMama.pwn(158) : warning 215: expression has no effect
C:\Documents and Settings\Toniu\Desktop\YoMama.pwn(158) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Toniu\Desktop\YoMama.pwn(158) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Toniu\Desktop\YoMama.pwn(158) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
5 Errors.
Re: I need help with OnPlayerToPoint please -
Rks25 - 20.04.2009
This is how it should be:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;
if(!strcmp("/blah", cmdtext, true))
{
if(PlayerToPoint(2.0,1633.2205,-1019.4009,23.8984))
{
SendClientMessage(playerid, COLOR_YELLOW, "blah blah blah blah !");
GivePlayerWeapon(playerid,3,1);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1602.8052,-1009.7886,23.9063);
GameTextForPlayer(playerid,"~w~BLAH BLAH ~y~BLAH BLAH ",5000,5);
}
return 1;
}
return 0;
}
Re: I need help with OnPlayerToPoint please -
*ToM* - 20.04.2009
Nope, still the same errors,
Re: I need help with OnPlayerToPoint please -
Rks25 - 20.04.2009
anyways that was wrong too, but did you include the function playertopoint in the gm, or did you only use it?
Re: I need help with OnPlayerToPoint please -
*ToM* - 20.04.2009
Код:
#include <a_samp>
#define FILTERSCRIPT
// Colors
#define COLOR_WHITE
#define COLOR_GREEN
#define COLOR_LIGHTGREEN
#define COLOR_RED
#define COLOR_DRED
#define COLOR_BLUE
#define COLOR_ROYAL
#define COLOR_DBLUE
#define COLOR_LIGHTBLUE
#define COLOR_YELLOW
#define COLOR_PURPLE
#pragma tabsize 0
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
Re: I need help with OnPlayerToPoint please -
pspleo - 20.04.2009
You only forwarded it. Implent the function itself first.
Leopard
Re: I need help with OnPlayerToPoint please -
*ToM* - 20.04.2009
How can I do this
Re: I need help with OnPlayerToPoint please -
ICECOLDKILLAK8 - 20.04.2009
Add this anywhere in your script (As long as it isnt in another function)
pawn Код:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}