OneShoot, look http://wiki.sa-mp.com/wiki/IsPlayerInRangeOfPoint,
da kannste dir genau durch lesen wenn du was nicht verstehst.
maddin, die Abfrage mit else kann man einfach direkt in eine Zeile packen,
entweder so
if(strcmp(cmdtext,"/Einfahrt",true)==0)
{
if(!IsPlayerInRangeOfPoint(playerid,Radius,X,Y,Z))
{
SendClientMessage(playerid,Farbe,"Du bist nicht am bestimmten Platz!");
return 1;
}
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehid,1235.5044,-1303.3871,-99.5134);
SetVehicleZAngle(playerid,181.3850);
LinkVehicleToInterior(playerid,0);
SetPlayerInterior(playerid,0);
SendClientMessage(playerid,0x00FF00FF,"");
}
else
{
SetPlayerPos(playerid,1235.5044,-1303.3871,-99.5134);
SetPlayerFacingAngle(playerid,181.3850);
SetPlayerInterior(playerid,0);
SendClientMessage(playerid,0x00ff00ff,"");
}
return 1;
}
oder einfacher
if(strcmp(cmdtext,"/Einfahrt",true)==0)
{
if(!IsPlayerInRangeOfPoint(playerid,Radius,X,Y,Z)) return SendClientMessage(playerid,Farbe,"Du bist nicht am bestimmten Platz!");
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehid,1235.5044,-1303.3871,-99.5134);
SetVehicleZAngle(playerid,181.3850);
LinkVehicleToInterior(playerid,0);
SetPlayerInterior(playerid,0);
SendClientMessage(playerid,0x00FF00FF,"");
}
else
{
SetPlayerPos(playerid,1235.5044,-1303.3871,-99.5134);
SetPlayerFacingAngle(playerid,181.3850);
SetPlayerInterior(playerid,0);
SendClientMessage(playerid,0x00ff00ff,"");
}
return 1;
}
Mfg