error 008: must be a constant expression; assumed zero
GetRegionCheck(Float:posx[iidd],Float:posy[iidd],Float:posz[iidd])
new iidd; new Float:posx[MAX_PLAYERS]; new Float:posy[MAX_PLAYERS]; new Float:posz[MAX_PLAYERS]; GetRegionCheck(Float:posx[iidd],Float:posy[iidd],Float:posz[iidd]) { new zone[256]; for (new r=0; r < MAX_REGIONS; r++) { if(posx[iidd]>=gRegionCoords[r][0] && posx[iidd]<=gRegionCoords[r][3] && posy[iidd]>=gRegionCoords[r][1] && posy[iidd]<=gRegionCoords[r][4] && posz[iidd]>=gRegionCoords[r][2] && posz[iidd] < gRegionCoords[r][5]) { format(zone, sizeof(zone), "%s", gRegionNames[r]); break; } } return zone; }
GetRegionCheck(Float:posx,Float:posy,Float:posz)
{
new zone[256];
for (new r=0; r < MAX_REGIONS; r++)
{
if(posx>=gRegionCoords[r][0] && posx<=gRegionCoords[r][3] && posy>=gRegionCoords[r][1] && posy<=gRegionCoords[r][4] && posz>=gRegionCoords[r][2] && posz < gRegionCoords[r][5])
{
format(zone, sizeof(zone), "%s", gRegionNames[r]);
break;
}
}
return zone;
}
Originally Posted by dice7
An array is basiclly a table with data stored in each cell (new a[24] = 24 cells = 24 stored numbers). You cannot compare the whole array with one number. Try this code:
pawn Код:
|
new Text:txt;
new Text:txt2;
ONGAMEMODEINIT:
txt2 = TextDrawCreate(445.0, 411.5, "lol");
txt = TextDrawCreate(430.0, 400.0, "lol");
ONPLAYERCONNECT:
SetTimerEx("location",1000,1,"i",playerid);
public location(id)
{
new string[300];
new string2[300];
format(string,300,"Your location is:");
TextDrawSetString(txt,string);
TextDrawSetShadow(txt, 0);
TextDrawAlignment(txt, 4);
TextDrawColor(txt, COLOR_YELLOW);
TextDrawShowForPlayer(id, txt);
format(string2,300,"%s",GetRegionCheck(pos));
TextDrawSetString(txt2,string2);
TextDrawSetShadow(txt2, 0);
TextDrawAlignment(txt2, 4);
TextDrawColor(txt2, COLOR_RED);
TextDrawShowForPlayer(id, txt2);
}