A few Errors on my Server, (To Do with PlayertoPoint) -
Matthew_Johnston - 08.07.2010
Now I Have this as my /enter and /exit Script.
}
if(!strcmp("/Enter", cmdtext, true))
{
if PlayerToPoint(2116.6833,2416.7131,49.5234);
SetPlayerPos(playerid, 354.9854,150.2702,1025.7964,359.891
;
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, 1);
return 1;
}
if(!strcmp("/Exit", cmdtext, true))
{
if PlayerToPoint(354.9854,150.2702,1025.7964,359.8918 );
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 2116.6833,2416.7131,49.5234);
return 1;
}
return 0;
}
And I Have Copyed a playertopoint off a Tutorial on the forums
( PLAYER TO POINT )
public PlayerToPoint(Float:radi, playerid, Float
, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
new Float
ldposx, Float
ldposy, Float
ldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
Now When I Compile I Get an Error Saying that :
C:\Program Files\SAMP\SAMP\SAMP\gamemodes\RP2.pwn(472) : error 001: expected token: "*then", but found ";"
C:\Program Files\SAMP\SAMP\SAMP\gamemodes\RP2.pwn(472) : error 036: empty statement
Now Thats my Problem, I Cant seem to get the pattern of Playertopoint to work for me :P Help nao?
Re: A few Errors on my Server, (To Do with PlayertoPoint) -
Despare - 08.07.2010
Which line is 472?
I believe that PlayerToPoint has more than just the coords.
It's suppose to be PlayerToPoint(25.0,playerid,354.9854,150.2702,1025 .7964,359.891
Representing the radius/distance
Re: A few Errors on my Server, (To Do with PlayertoPoint) -
Matthew_Johnston - 08.07.2010
MMkay. Oh and Line 472 is..
if PlayerToPoint(354.9854,150.2702,1025.7964,359.8918 );
Re: A few Errors on my Server, (To Do with PlayertoPoint) -
Matthew_Johnston - 08.07.2010
Damnit Now it says 464) : error 029: invalid expression, assumed zero
Line 464 is:
if PlayerToPoint(25.0,playerid,354.9854,150.2702,1025 .7964,359.891);
Shitballs, Im Feeling the Pain :P
Re: A few Errors on my Server, (To Do with PlayertoPoint) -
Adil - 08.07.2010
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 25.0, 354.9854,150.2702,1025.7964))
Next time, use
[code] if you want to put a script over here.
Re: A few Errors on my Server, (To Do with PlayertoPoint) -
Hiddos - 08.07.2010
You're doing it wrong.
You're having:
pawn Код:
if PlayerToPoint(2116.6833,2416.7131,49.5234);
The symbol ';' is used for functions like SendClientMessage, not for checking things like 'if(IsPlayerAdmin(playerid))'
The function PlayerToPoint is:
pawn Код:
PlayerToPoint(Float:radi,playerid,Float:x,Float:y,Float:z;)
You're only filling in the 'X', the 'Y' and the 'Z', not the radius and the playerid.
Try this for example:
pawn Код:
if(PlayerToPoint(10,playerid2116.6833,2416.7131,49.5234))
Re: A few Errors on my Server, (To Do with PlayertoPoint) -
Adil - 08.07.2010
Quote:
Originally Posted by Hiddos
You're doing it wrong.
You're having:
pawn Код:
if PlayerToPoint(2116.6833,2416.7131,49.5234);
The symbol ';' is used for functions like SendClientMessage, not for checking things like 'if(IsPlayerAdmin(playerid))'
The function PlayerToPoint is:
pawn Код:
PlayerToPoint(Float:radi,playerid,Float:x,Float:y,Float:z;)
You're only filling in the 'X', the 'Y' and the 'Z', not the radius and the playerid.
Try this for example:
pawn Код:
if(PlayerToPoint(10,playerid2116.6833,2416.7131,49.5234))
|
Basically he means to not to use ';' in conditions. And you also don't need to use PlayerToPoint, we have a better one now, it's IsPlayerInRangeOfPoint.