Can someone please write a basic stock for GetPlayerArea or something? This is too complicated for me to understand.
My script doesn't have overlapping areas so returning multiple results is not an issue. |
new playerarea[MAX_PLAYERS]; GetPlayerArea(playerid) return IsPlayerConnected(playerid) ? playerarea[playerid] : -1; public OnPlayerConnect(playerid) { playerarea[playerid] = -1; return 1; } public OnPlayerEnterDynamicArea(playerid, areaid) { playerarea[playerid] = areaid; return 1; } public OnPlayerLeaveDynamicArea(playerid, areaid) { playerarea[playerid] = -1; return 1; }
Can I use the latest version of this plugin on a server with 1000 slots? I know that in the past there was a 1000p version of the plugin.
|
I've tested the plugin locally with 0.3.7 (Windows) + 1000 slots in server.cfg and it runs fine.
Obviously I can't reach 1000 players, so I don't know what happens with real players. |
- The server will only come in a 1000 player variation from now on since there should be no performance difference between a 500 player server and 1000 player server. |
SetDynamicObjectNoCameraCol(objectid);
How to check whether a point/coordinate is in an area and return it in text? I don't have overlapping areas
I played around with IsPointInDynamicArea a little but not sure how to return the result |
stock IsPointInDynamicAreaEx(areaid, Float: x, Float: y, Float: z)
{
new string[64];
if(IsPointInDynamicArea(areaid, x, y, z)) // In Area
{
format(string, sizeof(string), "%s", stringhere);
return string; // Strings cannot be returned directly due to a bug in the compiler
}
else // Not in area
{
format(string, sizeof(string), "%s", stringhere);
return string;
}
}
#define STREAMER_VEHICLE_TYPE_STATIC (0)
#define STREAMER_VEHICLE_TYPE_DYNAMIC (1)
native AttachDynamicObjectToVehicle(objectid, vehicleid, Float:offsetx, Float:offsety, Float:offsetz, Float:rx, Float:ry, Float:rz, vehicletype = STREAMER_VEHICLE_TYPE_DYNAMIC);
forward OnDynamicVehicleSpawn(vehicleid);
forward OnDynamicVehicleDeath(vehicleid, killerid);
forward OnPlayerEnterDynamicVehicle(playerid, vehicleid, ispassenger);
forward OnPlayerExitDynamicVehicle(playerid, vehicleid);
forward OnDynamicVehicleMod(playerid, vehicleid, componentid);
forward OnDynamicVehiclePaintjob(playerid, vehicleid, paintjobid);
forward OnDynamicVehicleRespray(playerid, vehicleid, color1, color2);
forward OnDynamicVehDamageStatusUpdate(vehicleid, playerid);
forward OnUnoccupiedDynamicVehUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z);
forward OnDynamicVehicleStreamIn(vehicleid, forplayerid);
forward OnDynamicVehicleStreamOut(vehicleid, forplayerid);
native CreateDynamicVehicle(modelid, Float:fX, Float:fY, Float:fZ, Float:fRot, color1, color2, respawndelay, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 300.0);
native DestroyDynamicVehicle(vehicleid);
native IsValidDynamicVehicle(vehicleid);
native IsDynamicVehicleStreamedIn(vehicleid, forplayerid);
native GetDynamicVehiclePos(vehicleid, &Float:x, &Float:y, &Float:z);
native SetDynamicVehiclePos(vehicleid, Float:x, Float:y, Float:z);
native GetDynamicVehicleZAngle(vehicleid, &Float:z_angle);
native GetDynamicVehicleRotationQuat(vehicleid, &Float:w, &Float:x, &Float:y, &Float:z);
native SetDynamicVehicleZAngle(vehicleid, Float:z_angle);
native SetDynamicVehParamsForPlayer(vehicleid,playerid,objective,doorslocked);
native SetDynamicVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
native GetDynamicVehicleParamsEx(vehicleid, &engine, &lights, &alarm, &doors, &bonnet, &boot, &objective);
native SetDynamicVehicleToRespawn(vehicleid);
native LinkDynamicVehicleToInterior(vehicleid, interiorid);
native AddDynamicVehicleComponent(vehicleid, componentid);
native RemoveDynamicVehicleComponent(vehicleid, componentid);
native ChangeDynamicVehicleColor(vehicleid, color1, color2);
native ChangeDynamicVehiclePaintjob(vehicleid, paintjobid);
native SetDynamicVehicleHealth(vehicleid, Float:health);
native GetDynamicVehicleHealth(vehicleid, &Float:health);
native AttachTrailerToDynamicVehicle(trailerid, vehicleid);
native DetachTrailerFromDynamicVeh(vehicleid);
native IsTrailerAttachedToDynamicVeh(vehicleid);
native GetDynamicVehicleTrailer(vehicleid);
native SetDynamicVehicleNumberPlate(vehicleid, plate[]);
native GetDynamicVehicleModel(vehicleid);
native RepairDynamicVehicle(vehicleid); // Repairs the damage model and resets the health
native GetDynamicVehicleVelocity(vehicleid, &Float:X, &Float:Y, &Float:Z);
native SetDynamicVehicleVelocity(vehicleid, Float:X, Float:Y, Float:Z);
native SetDynamicVehAngularVelocity(vehicleid, Float:X, Float:Y, Float:Z);
native GetDynamicVehicleDamageStatus(vehicleid, &panels, &doors, &lights, &tires);
native UpdateDynamicVehDamageStatus(vehicleid, panels, doors, lights, tires);
native GetPlayerSurfingDynamicVehID(playerid);
native PutPlayerInDynamicVehicle(playerid, vehicleid, seatid);
native GetPlayerDynamicVehicleID(playerid);
native IsPlayerInDynamicVehicle(playerid, vehicleid);
native IsPlayerInAnyDynamicVehicle(vehicleid);
native PlayerSpectateDynamicVehicle(playerid, targetvehicleid, mode = SPECTATE_MODE_NORMAL);
I know this is not really a very necessary native, but take a look:
https://sampwiki.blast.hk/wiki/CancelEdit Could you add CancelDynamicEdit(playerid)? I just want to cancel the object edit mode of a player without it bugging. Though I found a not-so-effective way of doing it by using CallLocalFunction to call the OnPlayerEditDynamicObject callback manually with EDIT_RESPONSE_CANCEL specified on the "response" parameter. But this way I still need to press ESC to fully cancel the object edit mode, that's why I'm asking if you could add the native above. |
I am pretty sure CancelEdit applies for player objects too. Can you confirm it not to be working?
|