Version 1.0 - It includes the release. Version 1.1 - Inserted: CreateRhombusZone() e CreateTriangleZone(); Changed: GetTypeZone() in GetZoneType();
native CreateZone(Float:minX, Float:minY, Float:maxX, Float:maxY, color = COLOR_WHITE, name[] = "None", type[] = "None"); native CreateZoneByRange(Float:X, Float:Y, Float:Range = 5.0, color = COLOR_WHITE, name[] = "None", type[] = "Safe"); // NEW native CreateRhombusZone(Float:X, Float:Y, Float:Range = 50.0, color = COLOR_WHITE, name[] = "None", type[] = "None") native CreateTriangleZone(Float:X, Float:Y, Float:Range = 50.0, cardinalPoint[] = "North", color = COLOR_WHITE, name[] = "None", type[] = "None") // native GetZoneType(zoneid); // Changed native GetZoneName(zoneid); // Player functions native IsPlayerInZone(playerid, zoneid); native IsPlayerInAnyZone(playerid); native GetPlayerZone(playerid); native Zone_OnPlayerConnect(playerid);
CreateZone(Float:minX, Float:minY, Float:maxX, Float:maxY, color = COLOR_WHITE, name[] = "None", type[] = "None"); Float:minX - Minimum coordinate X. Float:minY - Minimum coordinate Y. Float:maxX - Maximum coordinate X. Float:maxY - Maximum coordinate Y. color - The colors already defined are red, green, blue, yellow, white (default), gray and blue. name[24] - The name of the area. If not set it will be "Zone id". Type[24] - The type of area. If not set it will be "None". Will return the id of the area. CreateZoneByRange(Float:X, Float:Y, Float:Range = 5.0, color = COLOR_WHITE, name[] = "None", type[] = "Safe"); Watch function Create Zone. Float:Rage - Necessary to calculate the minimum and maximum coordinates. Default is 5.0.
CreateRhombusZone(Float:X, Float:Y, Float:Range = 50.0, color = COLOR_WHITE, name[] = "None", type[] = "None"); Float:X - Coordinate X. Float:Y - Coordinate Y. Float:Rage - Necessary to calculate the minimum and maximum coordinates. Default is 5.0. color - The colors already defined are red, green, blue, yellow, white (default), gray and blue. name[24] - The name of the area. If not set it will be "Zone id". Type[24] - The type of area. If not set it will be "None". Will Returns the number of zones created.
CreateTriangleZone(Float:X, Float:Y, Float:Range = 50.0, cardinalPoint[] = "North", color = COLOR_WHITE, name[] = "None", type[] = "None"); Float:X - Coordinate X. Float:Y - Coordinate Y. Float:Rage - Necessary to calculate the minimum and maximum coordinates. Default is 50.0. cardinalPoint[] - It indicates the direction of the triangle. Default is "North". color - The colors already defined are red, green, blue, yellow, white (default), gray and blue. name[24] - The name of the area. If not set it will be "Zone id". Type[24] - The type of area. If not set it will be "None". Will Returns the number of zones created.
GetZoneType(zoneid); - Returns the type of the area giving it as input the id. GetZoneName(zoneid); - Returns the name of the area giving it as input the id.
IsPlayerInZone(playerid, zoneid); - Returns 1 if the player is in that area else 0. IsPlayerInAnyZone(playerid); - Returns 1 if the player is in any zone else 0. GetPlayerZone(playerid); - Return the id of the area where the player else 0.
Zone_OnPlayerConnect(playerid); - Added OnPlayerConnect of your GM in case of include OnPlayerConnect cause problems.
forward OnPlayerEnterZone(playerid, zoneid); - It is prompted when the player enters a zone. forward OnPlayerExitZone(playerid, zoneid); - It is prompted when the player comes out of a zone.
public OnPlayerEnterZone(playerid,zoneid) { if(strcmp(GetTypeZone(zoneid), "Blue")==0) { GameTextForPlayer(playerid, "~b~You went into a blue zone.", 3000, 3); } else if(strcmp(GetTypeZone(zoneid), "Red")==0) { GameTextForPlayer(playerid, "~r~Warning!~n~~w~You went into a red zone.", 3000, 3); } else GameTextForPlayer(playerid, "~w~You went into a zone.", 3000, 3); return 1; } public OnPlayerExitZone(playerid,zoneid) { GameTextForPlayer(playerid, "~w~You are come out of a zone.", 3000, 3); return 1; }
pawn Код:
|
This is a good idea but the implementation method is like this was written in 2007.
|