05.02.2016, 13:05
Is it possible to set area types using incognitos streamer plugin?
Like...
Business Areas
Item Areas
etc..
Like...
Business Areas
Item Areas
etc..
Data Manipulation: Код:
native Streamer_GetFloatData(type, STREAMER_ALL_TAGS id, data, &Float:result); native Streamer_SetFloatData(type, STREAMER_ALL_TAGS id, data, Float:value); native Streamer_GetIntData(type, STREAMER_ALL_TAGS id, data); native Streamer_SetIntData(type, STREAMER_ALL_TAGS id, data, value); native Streamer_GetArrayData(type, STREAMER_ALL_TAGS id, data, dest[], maxdest = sizeof dest); native Streamer_SetArrayData(type, STREAMER_ALL_TAGS id, data, const src[], maxsrc = sizeof src); native Streamer_IsInArrayData(type, STREAMER_ALL_TAGS id, data, value); native Streamer_AppendArrayData(type, STREAMER_ALL_TAGS id, data, value); native Streamer_RemoveArrayData(type, STREAMER_ALL_TAGS id, data, value); native Streamer_GetUpperBound(type); |
#define AREA_TYPE_BUSINESS (0)
Streamer_SetIntData(STREAMER_TYPE_AREA, area_id, E_STREAMER_EXTRA_ID, AREA_TYPE_BUSINESS);
if (Streamer_GetIntData(STREAMER_TYPE_AREA, area_id, E_STREAMER_EXTRA_ID) == AREA_TYPE_BUSINESS )
{
// its business area
}
Yes you can do with the following section:
Example: pawn Код:
|
BusinessInfo[b][bLandlineArea] = CreateDynamicArea(areaid); <--- EXAMPLE (I know it's not the correct format)
Streamer_SetInt(STREAMER_TYPE_AREA, BusinessInfo[b][bLandlineArea], E_STREAMER_TYPE, BUSINESS_LANDLINE_AREA);
Streamer_SetInt(STREAMER_TYPE_AREA, BusinessInfo[b][bLandlineArea], E_STREAMER_EXTRA_ID, b);
public OnPlayerEnterDynamicArea(playerid, areaid)
{
if(Streamer_GetInt(STREAMER_TYPE_AREA, areaid, E_STREAMER_TYPE) == BUSINESS_LANDLINE_AREA)
{
new b = Streamer_GetInt(STREAMER_TYPE_AREA, areaid, E_STREAMER_EXTRA_ID);
LandlineInteraction[playerid] = 1;
LandlineNo[playerid] = BusinessInfo[b][bLandlineNo];
LandlineCode[playerid] = BusinessInfo[b][bLandlineCode];
//THE PLAYER CAN NOW USE HOTKEY TO INTERACT WITH LANDLINE
}
}
#define AREA_TYPE_BUSINESS 1; #define AREA_TYPE_BLAHBLAH 2; enum areas_info { Type, AreaID } new Areas[MAX_AREAS][areas_info]; AreasInt() { Areas[0][Type] = AREA_TYPE_BUSINESS; Areas[0][AreaID] = CreateDynamicRectangle(...); Areas[1][Type] = AREA_TYPE_BUSINESS; Areas[1][AreaID] = CreateDynamicRectangle(...); Areas[2][Type] = AREAY_TYPE_BLAHBLAH; Areas[2][AreaID] = CreateDynamicRectangle(...); } IsBusinessArea(areaid) { // If is business if (Areas[10][Type] == AREA_TYPE_BUSINESS) return true; // If not return false; }
Check this out:
Код:
#define AREA_TYPE_BUSINESS 1; #define AREA_TYPE_BLAHBLAH 2; enum areas_info { Type, AreaID } new Areas[MAX_AREAS][areas_info]; AreasInt() { Areas[0][Type] = AREA_TYPE_BUSINESS; Areas[0][AreaID] = CreateDynamicRectangle(...); Areas[1][Type] = AREA_TYPE_BUSINESS; Areas[1][AreaID] = CreateDynamicRectangle(...); Areas[2][Type] = AREAY_TYPE_BLAHBLAH; Areas[2][AreaID] = CreateDynamicRectangle(...); } IsBusinessArea(areaid) { // If is business if (Areas[10][Type] == AREA_TYPE_BUSINESS) return true; // If not return false; } |
Would this work in the following way? Am I able to use it like this?
pawn Код:
|
#define AREA_TYPE_BUSINESS 1;
#define AREA_TYPE_BLAHBLAH 2;
new AreaTypes[MAX_AREAS];
AreasInt()
{
new areaid;
areaid = CreateDynamicRectangle(...);
AreaTypes[areaid] = AREA_TYPE_BUSINESS;
areaid = CreateDynamicRectangle(...);
AreaTypes[areaid] = AREA_TYPE_BUSINESS;
areaid = CreateDynamicRectangle(...);
AreaTypes[areaid] = AREAY_TYPE_BLAHBLAH;
}
OnPlayerEnterDynamicArea(playerid, areaid);
{
If (AreaTypes[areaid] == AREA_TYPE_BUSINESS)
{
// Do something
}
}
enum vData
{
Fuel,
Color1,
Color2,
Float:x,
Float:y,
Float:z
}
new VehicleData[MAX_VEHICLES][vData];
InitVehicles()
{
new vehicleid;
vehicleid = CreateVehicle(...);
VehicleData[vehicleid][Fuel] = 20;
VehicleData[vehicleid][Color1] = 1;
VehicleData[vehicleid][Color2] = 5;
VehicleData[vehicleid][x] = 100.0;
VehicleData[vehicleid][y] = 1750.0;
VehicleData[vehicleid][z] = 5.9;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if (VehicleData[vehicleid][Fuel] == 0)
// Turn off engine and inform player (or whatever)
return 1;
}