24.12.2009, 11:26
IsPlayerInRangeOfVehicle
NearByMessage
RespawnVehicles
SecondsToMinutes and MinutesToSeconds (not very useful, as you can simply use the sum every single math calculation):
pawn Код:
public IsPlayerInRangeOfVehicle(playerid, vehicleid, radius)
{
new Float: CarPpX, Float: CarPpY, Float: CarPpZ;
GetVehiclePos(playerid, CarPpX, CarPpY, CarPpZ);
if(IsPlayerInRangeOfPoint(playerid, radius, CarPpX, CarPpY, CarPpZ))
{
return 1;
}
else
{
return 0;
}
}
pawn Код:
public NearByMessage(playerid, color, string[], Float: range)
{
new Float: PlayerX, Float: PlayerY, Float: PlayerZ;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(playerid, PlayerX, PlayerY, PlayerZ);
if(IsPlayerInRangeOfPoint(i, range, PlayerX, PlayerY, PlayerZ))
{
if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
{
SendClientMessage(i, color, string);
}
}
}
}
}
pawn Код:
public MassRespawn()
{
for(new i = 0; i < MAX_VEHICLES; i++)
{
SetVehicleToRespawn(i);
}
}
pawn Код:
public MinutesToSeconds(minutes)
{
return minutes*60;
}
public SecondsToMinutes(seconds)
{
return seconds/60;
}