17.11.2009, 20:00
please check this code for me, and tell if have something wrong.
this is code about zone, I am create it with my own. i want to check when have someone walk to this zone,and when me complie
D:\BTM\gamemodes\repair.pwn(292) : error 025: function heading differs from prototype
it have this error, please explain it for me.
sorry for my bad english.
thx you!!
forward IsPlayerInZone(playerid,Float:zone_minx,Float:zone _miny,Float:zone_maxx,Float:zone_maxy);
public IsPlayerInZone(playerid,Float:zone_minx,Float:zone _miny,Float:zone_maxx,Float:zone_maxy)
{
if(IsPlayerConnected(playerid))
{
new Floatlyx,Floatlyy,Floatlyz;
GetPlayerPos(playerid,plyx,plyy,plyz);
if((plyx > zone_minx) || (plyx < zone_maxx) || (plyy > zone_maxy) || (plyy < zone_miny))
{
return 1;
}
}
return 0;
}
and this is command for create zone
if(strcmp(cmd,"/createzone",true)== 0)
{
if(IsPlayerConnected(playerid))
{
new gangzone;
tmp = strtok(cmdtext,idx);
new amount = strval(tmp);
if(amount > 0)
{
if(pGangZoneCreate[playerid] == 0)
{
new Float,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
new Float:zone_minx,Float:zone_miny,Float:zone_maxx,Fl oat:zone_maxy;
zone_minx = x;
zone_miny = y+amount;
zone_maxx = x+amount;
zone_maxy = y;
gangzone = GangZoneCreate(zone_minx,zone_miny,zone_maxx,zone_ maxy);
GangZoneShowForPlayer(playerid,gangzone,COLOR_RED) ;
pGangZoneCreate[playerid] = 1;
}
else
{
SendClientMessage(playerid,COLOR_RED,"you is already Createzone");
SendClientMessage(playerid,COLOR_RED,"so, your old zone will has destroy now. ");
pGangZoneCreate[playerid] = 0;
GangZoneDestroy(gangzone);
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"/createzone [area of zone]");
return 1;
}
}
return 1;
}
return 0;
}
this is code about zone, I am create it with my own. i want to check when have someone walk to this zone,and when me complie
D:\BTM\gamemodes\repair.pwn(292) : error 025: function heading differs from prototype
it have this error, please explain it for me.
sorry for my bad english.
thx you!!
forward IsPlayerInZone(playerid,Float:zone_minx,Float:zone _miny,Float:zone_maxx,Float:zone_maxy);
public IsPlayerInZone(playerid,Float:zone_minx,Float:zone _miny,Float:zone_maxx,Float:zone_maxy)
{
if(IsPlayerConnected(playerid))
{
new Floatlyx,Floatlyy,Floatlyz;
GetPlayerPos(playerid,plyx,plyy,plyz);
if((plyx > zone_minx) || (plyx < zone_maxx) || (plyy > zone_maxy) || (plyy < zone_miny))
{
return 1;
}
}
return 0;
}
and this is command for create zone
if(strcmp(cmd,"/createzone",true)== 0)
{
if(IsPlayerConnected(playerid))
{
new gangzone;
tmp = strtok(cmdtext,idx);
new amount = strval(tmp);
if(amount > 0)
{
if(pGangZoneCreate[playerid] == 0)
{
new Float,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
new Float:zone_minx,Float:zone_miny,Float:zone_maxx,Fl oat:zone_maxy;
zone_minx = x;
zone_miny = y+amount;
zone_maxx = x+amount;
zone_maxy = y;
gangzone = GangZoneCreate(zone_minx,zone_miny,zone_maxx,zone_ maxy);
GangZoneShowForPlayer(playerid,gangzone,COLOR_RED) ;
pGangZoneCreate[playerid] = 1;
}
else
{
SendClientMessage(playerid,COLOR_RED,"you is already Createzone");
SendClientMessage(playerid,COLOR_RED,"so, your old zone will has destroy now. ");
pGangZoneCreate[playerid] = 0;
GangZoneDestroy(gangzone);
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"/createzone [area of zone]");
return 1;
}
}
return 1;
}
return 0;
}