if(!IsPlayerInAnyVehicle(playerid)){ //Check to make sure a player is not in a vehicle
if(IsPlayerInRangeOfPoint(playerid, 4.0, -2409.3364,-2189.7725,34.0391)){
SendClientMessage(playerid, 0xFFFFFFFF, "Do you need a lift to the top? type /lift");
if(!strcmp("/lift", cmd)) { //Works with or without the !
SetPlayerPos(playerid,-2232.8716,-1737.5121,480.8323);
}
}
}
|
Originally Posted by adsy
I am looking to create a teleport command that only works when a player is in the vicinity of a point. The script works but it doesnt display the text BEFORE the command is entered.
here is what i have in my onplayercommandtext Код:
if(!IsPlayerInAnyVehicle(playerid)){ //Check to make sure a player is not in a vehicle
if(IsPlayerInRangeOfPoint(playerid, 4.0, -2409.3364,-2189.7725,34.0391)){
SendClientMessage(playerid, 0xFFFFFFFF, "Do you need a lift to the top? type /lift");
if(!strcmp("/lift", cmd)) { //Works with or without the !
SetPlayerPos(playerid,-2232.8716,-1737.5121,480.8323);
}
}
}
|
if(!strcmp("/lift", cmd))
{ //Works with or without the !
if(!IsPlayerInAnyVehicle(playerid))
{ //Check to make sure a player is not in a vehicle
if(IsPlayerInRangeOfPoint(playerid, 4.0, -2409.3364,-2189.7725,34.0391))
{
SendClientMessage(playerid, 0xFFFFFFFF, "Do you need a lift to the top? type /lift");
SetPlayerPos(playerid,-2232.8716,-1737.5121,480.8323);
}
}
return 1;
}
|
Originally Posted by patchkinson
yup, i was late, you need to make it return something, in this case a simple return 1; would fix it!
|
if(!IsPlayerInAnyVehicle(playerid)){ //Check to make sure a player is not in a vehicle
if(IsPlayerInRangeOfPoint(playerid, 4.0, -2409.3364,-2189.7725,34.0391)){
if(!strcmp("/lift", cmd)) { //Works with or without the !
SetPlayerPos(playerid,-2232.8716,-1737.5121,480.8323);
}
}
return 1;
}
new mountain;
mountain = CreatePickup(1239, 19, -2409.3364,-2189.7725,34.0391, 0);
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == mountain){
SendClientMessage(playerid, 0xFFFFFFFF, "Do you need a lift to the top? type /lift");
}
}