Can some one help me do a damn /enter and /exit command -
Karl1195 - 14.08.2010
Can some one help me do a damn /enter and /exit command i have been asking this questions ages and no one help me please i really need to know how.. i did a prison and when i try to copy paste other /enter commands it don't work i need it ready in 1hour.. have been looking all day ;/
Thanks a lot
Karl1195
Re: Can some one help me do a damn /enter and /exit command -
juuleman - 14.08.2010
Use SetPlayerPos, IsPlayerInRangeOfPoint and if you use an Interior, SetPlayerInterior.
Good Luck!
Re: Can some one help me do a damn /enter and /exit command -
Redgie - 14.08.2010
Do it in steps:
Step 1: Recognize the command /enter
Step 2: Check if the player is at the /enter position (Using PlayerToPoint (Posted Below))
Step 3: If the above is true, set the players new position inside the prison
pawn Код:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
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;
}
Usage:
pawn Код:
if(PlayerToPoint(distance,playerid,X-Value,Y-Value,Z-Value))
{
//Move the player
}
else
{
//Send error message / do not move player
}
Re: Can some one help me do a damn /enter and /exit command -
Karl1195 - 14.08.2010
ya but where is the /enter command i already kinda tryed some thing similar.
Re: Can some one help me do a damn /enter and /exit command -
Vince - 14.08.2010
Quote:
Originally Posted by Redgie
Using PlayerToPoint
|
Do you live in the stone age?
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Re: Can some one help me do a damn /enter and /exit command -
Karl1195 - 14.08.2010
yep, i can't fucken do this !
Can some one do it for me and tell me where should i place the stuff i got 80k lines fucken raven's roleplay and i need this shit..
Co-Ordinates
Код:
AddPlayerClass(287,1772.4011,-1548.4357,9.9063,221.5886,0,0,0,0,0,0); // enter prison from here
AddPlayerClass(287,1770.2963,-1546.3507,9.9260,34.8402,0,0,0,0,0,0); // spawn here when you exit prison
AddPlayerClass(287,1808.6891,-1312.6675,197.1969,85.9376,0,0,0,0,0,0); // spawn here when you enter prison
AddPlayerClass(287,1810.3650,-1312.7653,197.1969,266.7327,0,0,0,0,0,0); // exit prison from here
Re: Can some one help me do a damn /enter and /exit command -
playbox12 - 14.08.2010
Offtopic, Karl you link to an website that sells scripts, its against the rules. I should delete it if I were you or you can face a ban. (I talk about your signature)
Re: Can some one help me do a damn /enter and /exit command -
Karl1195 - 14.08.2010
please code it and explain to me bit by bit i really be pleased if some one help me [[Sorry for my english it sucks]]
Re: Can some one help me do a damn /enter and /exit command -
Cameltoe - 14.08.2010
Quote:
Originally Posted by playbox12
Offtopic, Karl you link to an website that sells scripts, its against the rules. I should delete it if I were you or you can face a ban. (I talk about your signature)
|
Lol,we can advertise in our siggzz
Re: Can some one help me do a damn /enter and /exit command -
Ihsan_Cingisiz - 14.08.2010
Quote:
Originally Posted by Karl1195
yep, i can't fucken do this !
Can some one do it for me and tell me where should i place the stuff i got 80k lines fucken raven's roleplay and i need this shit..
Co-Ordinates
Код:
AddPlayerClass(287,1772.4011,-1548.4357,9.9063,221.5886,0,0,0,0,0,0); // enter prison from here
AddPlayerClass(287,1770.2963,-1546.3507,9.9260,34.8402,0,0,0,0,0,0); // spawn here when you exit prison
AddPlayerClass(287,1808.6891,-1312.6675,197.1969,85.9376,0,0,0,0,0,0); // spawn here when you enter prison
AddPlayerClass(287,1810.3650,-1312.7653,197.1969,266.7327,0,0,0,0,0,0); // exit prison from here
|
Here you go, a simple /enter//exit command for you..
If you need more help you can PM me..
Quote:
if(strcmp(cmd, "/enter", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 3, 1772.4011,-1548.4357,9.9063) {
SetPlayerInterior(playerid, /*Type /interior in the prison and type here the interior ID*/);
SetPlayerPos(playerid, 1808.6891,-1312.6675,197.1969);
return 1;
}
}
if(strcmp(cmd, "/exit", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 3, 1810.3650,-1312.7653,197.1969) (
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1770.2963,-1546.3507,9.9260);
return 1;
}
}
|