help wth if the player is not in the point - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help wth if the player is not in the point (
/showthread.php?tid=66130)
help wth if the player is not in the point -
glob1234 - 19.02.2009
I need a small amount of help, ive made a script for a /opengate using "playetopoint"
How do you make it so that if the player is not in the area that a message will come up
like "You cant do this here"
Код:
if(strcmp(cmdtext,"/opengate", true) == 0)
{
if (gTeam[playerid] == TEAM_POLICE)
{
if(PlayerToPoint(15.0, playerid,2333.207764, 2440.335449, 5.064778))
{
MoveObject(LVPDgate, 2333.207764, 2440.335449, 0.064778, 1.500000);
return 1;
}
Thats what we got so far.
Re: help wth if the player is not in the point -
Norn - 19.02.2009
Quote:
Originally Posted by glob1234
I need a small amount of help, ive made a script for a /opengate using "playetopoint"
How do you make it so that if the player is not in the area that a message will come up
like "You cant do this here"
Код:
if(strcmp(cmdtext,"/opengate", true) == 0)
{
if (gTeam[playerid] == TEAM_POLICE)
{
if(PlayerToPoint(15.0, playerid,2333.207764, 2440.335449, 5.064778))
{
MoveObject(LVPDgate, 2333.207764, 2440.335449, 0.064778, 1.500000);
return 1;
}
Thats what we got so far.
|
pawn Код:
if(strcmp(cmdtext,"/opengate", true) == 0)
{
if (gTeam[playerid] == TEAM_POLICE)
{
if(PlayerToPoint(15.0, playerid,2333.207764, 2440.335449, 5.064778))
{
MoveObject(LVPDgate, 2333.207764, 2440.335449, 0.064778, 1.500000);
return 1;
}
else
{
SendClientMessage(playerid,COLOR_COLOR,"You arn't at the correct location");
}
}
Re: help wth if the player is not in the point -
Lazarus - 19.02.2009
Eh, no.
pawn Код:
if(strcmp(cmdtext,"/opengate", true) == 0)
{
if (gTeam[playerid] == TEAM_POLICE)
{
if(PlayerToPoint(15.0, playerid,2333.207764, 2440.335449, 5.064778) == 1)
{
MoveObject(LVPDgate, 2333.207764, 2440.335449, 0.064778, 1.500000);
}
else
{
SendClientMessage(playerid, COLOR_COLOR, "You arn't at the correct location");
}
}
/*
else
{
SendClientMessage(playerid, COLOR_COLOR, "You are not an officer");
}
*/
}
return 1;
}
EDIT:
Nvm, you edited your post.
Re: help wth if the player is not in the point -
Norn - 19.02.2009
Quote:
Originally Posted by Lazarus
Eh, no.
pawn Код:
if(strcmp(cmdtext,"/opengate", true) == 0) { if (gTeam[playerid] == TEAM_POLICE) { if(PlayerToPoint(15.0, playerid,2333.207764, 2440.335449, 5.064778) == 1) { MoveObject(LVPDgate, 2333.207764, 2440.335449, 0.064778, 1.500000);
} else { SendClientMessage(playerid, COLOR_COLOR, "You arn't at the correct location"); } } /* else { SendClientMessage(playerid, COLOR_COLOR, "You are not an officer"); } */ } return 1; }
EDIT:
Nvm, you edited your post.
|
It's exactly the same as before, it looked like the IF statement was at a different location because of the indentation.
Re: help wth if the player is not in the point -
glob1234 - 19.02.2009
Ah i get it, thats brilliant thanks for your help to both of you