02.08.2012, 06:57
Hello, I'm using GetPlayer2DZone(playerid, zone[], len) and it's working fine but my question is how can I make custom zone names by Virtual Worlds?
My old code was this and it was working fine but I wanted to change because GetPlayer2DZone is better.
Do you have any idea how I can implent this in the new stock?
My old code was this and it was working fine but I wanted to change because GetPlayer2DZone is better.
pawn Код:
stock ReturnPlayerZone(playerid)
{
new playerzone[50] = "Unknown Location",
AmmuInMarket[50] = "Ammunation In Market(LS)",
AmmuInComeALot[50] = "Ammunation In Come-A-Lot",
AmmuInBoneCounty[50] = "Ammunation In Bone County",
AmmuInFortCarson[50] = "Ammunation In Fort Carson",
AmmuInElquabrados[50] = "Ammunation In El Quebrados",
LasVenturasPolice[50] = "Las Venturas Police Department",
LosSantosPolice[50] = "Los Santos Police Department",
SanFierroPolice[50] = "San Fierro Police Department",
FourDragonCasino[50] = "The Four Dragon Casino",
CaligulaCasino[50] = "Caligula's Casino";
for(new j; j < sizeof(zones); j++) {
if(IsPlayerInZone(playerid,j)) {
memcpy(playerzone, zones[j][zone_name], 0, 108);
break;
}
if(GetPlayerVirtualWorld(playerid) == 20) return LasVenturasPolice;
if(GetPlayerVirtualWorld(playerid) == 21) return SanFierroPolice;
if(GetPlayerVirtualWorld(playerid) == 22) return LosSantosPolice;
if(GetPlayerVirtualWorld(playerid) == 11) return AmmuInMarket;
if(GetPlayerVirtualWorld(playerid) == 12) return AmmuInComeALot;
if(GetPlayerVirtualWorld(playerid) == 13) return AmmuInBoneCounty;
if(GetPlayerVirtualWorld(playerid) == 14) return AmmuInFortCarson;
if(GetPlayerVirtualWorld(playerid) == 15) return AmmuInElquabrados;
if(GetPlayerVirtualWorld(playerid) == 23) return FourDragonCasino;
if(GetPlayerVirtualWorld(playerid) == 24) return CaligulaCasino;
}
return playerzone;
}
pawn Код:
stock GetPlayer2DZone(playerid, zone[], len) //Credits to Cueball, Betamaster, Mabako, and Simon (for finetuning).
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i = 0; i != sizeof(gSAZones); i++ )
{
if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4])
{
return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
}
}
return 0;
}