30.11.2011, 15:31
pawn Код:
forward GpsPlayer(playerid,playerid2,gpstype);
public GpsPlayer(playerid,playerid2,gpstype)
{
new string[128];
new Float:pX, Float:pY, Float:pZ, Float:idX, Float:idY, Float:idZ, Float:Distance,Float:Vida,Float:Colete;
GetPlayerPos(playerid,pX,pY,pZ);
GetPlayerPos(playerid2,idX,idY,idZ);
GetPlayerHealth(playerid2,Vida);
GetPlayerArmour(playerid2,Colete);
Distance = floatsqroot(floatpower(floatabs(floatsub(idX,pX)),2)+
floatpower(floatabs(floatsub(idY,pY)),2)+floatpower(floatabs(floatsub(idZ,pZ)),2));
if(IsPlayerConnected(playerid2))
{
for(new i = 0; i < MAX_PLAYERS; i++) if(i != playerid2 && i != playerid) SetPlayerMarkerForPlayer(playerid,i,(GetPlayerColor(i) & 0xFFFFFF00) | 0x00000011);
SetPlayerMarkerForPlayer(playerid,playerid2,GetPlayerColor(playerid2));
if(GetPlayerInterior(playerid2)==0 && GetPlayerInterior(playerid)==0 && GetPlayerState(playerid2) != 9)
{
for(new i=0; i < 12; i++)
{
if(idX >= CityInGps[i][X_MEN] && idX <= CityInGps[i][X_MAI] &&
idY >= CityInGps[i][Y_MEN] && idY <= CityInGps[i][Y_MAI])
{
if(gpstype==0)
{
format(string, sizeof(string), "~p~%s (id:%d)~n~~r~Distancia: ~y~%d metros~n~~r~Local: ~y~%s",
PlayerName(playerid2),playerid2,floatround(Distance),CityInGps[i][CITYNAME]);
}
else
{
if(GetPlayerWeapon(playerid2)==0)
{
if(IsPlayerInAnyVehicle(playerid2))
{
//ERRO NESSA LINHA format(string, sizeof(string), "~r~%s (id:%d)~n~~g~%d Metros %s~n~~r~Vida:%d Colete:%d~n~~b~Sem Arma %s",
//ERRO NESSA LINHA PlayerName(playerid2),playerid2,floatround(Distance),CityInGps[i][CITYNAME],floatround(Vida),floatround(Colete),vehName[GetVehicleModel(GetPlayerVehicleID(playerid2))-400]);
}
else
{
format(string, sizeof(string), "~r~%s (id:%d)~n~~g~%d Metros %s~n~~r~Vida:%d Colete:%d~n~~b~Sem Arma Sem Veiculo",
PlayerName(playerid2),playerid2,floatround(Distance),CityInGps[i][CITYNAME],floatround(Vida),floatround(Colete));
}
}
else
{
if(IsPlayerInAnyVehicle(playerid2))
{
format(string, sizeof(string), "~r~%s (id:%d)~n~~g~%d Metros %s~n~~r~Vida:%d Colete:%d~n~~b~%s %s",
PlayerName(playerid2),playerid2,floatround(Distance),CityInGps[i][CITYNAME],floatround(Vida),floatround(Colete),weaponNames(GetPlayerWeapon(playerid2)),vehName[GetVehicleModel(GetPlayerVehicleID(playerid2))-400]);
}
else
{
format(string, sizeof(string), "~r~%s (id:%d)~n~~g~%d Metros %s~n~~r~Vida:%d Colete:%d~n~~b~%s Sem Veiculo",
PlayerName(playerid2),playerid2,floatround(Distance),CityInGps[i][CITYNAME],floatround(Vida),floatround(Colete),weaponNames(GetPlayerWeapon(playerid2)));
}
}
}
TextDrawSetString(GPS[playerid],string);
}
}
}
else
{
if(gpstype==0) format(string, sizeof(string), "~g~%s (id:%d)~n~~b~Em Interior",PlayerName(playerid2),playerid2);
else
{
if(GetPlayerWeapon(playerid2)==0)
{
if(IsPlayerInAnyVehicle(playerid2))
{
format(string, sizeof(string), "~r~%s (id:%d)~n~~g~Em Interior~n~~b~Vida:%d Colete:%d~n~~g~Sem Arma %s",PlayerName(playerid2),playerid2,
floatround(Vida),floatround(Colete),vehName[GetVehicleModel(GetPlayerVehicleID(playerid2))-400]);
}
else
{
format(string, sizeof(string), "~r~%s (id:%d)~n~~g~Em Interior~n~~b~Vida:%d Colete:%d~n~~g~Sem Arma Sem Veiculo",PlayerName(playerid2),playerid2,
floatround(Vida),floatround(Colete));
}
}
else
{
if(IsPlayerInAnyVehicle(playerid2))
{
format(string, sizeof(string), "~r~%s (id:%d)~n~~g~Em Interior~n~~b~Vida:%d Colete:%d~n~~g~%s %s",PlayerName(playerid2),playerid2,
floatround(Vida),floatround(Colete),weaponNames(GetPlayerWeapon(playerid2)),vehName[GetVehicleModel(GetPlayerVehicleID(playerid2))-400]);
}
else
{
format(string, sizeof(string), "~r~%s (id:%d)~n~~g~Em Interior~n~~b~Vida:%d Colete:%d~n~~g~%s Sem Veiculo",PlayerName(playerid2),playerid2,
floatround(Vida),floatround(Colete),weaponNames(GetPlayerWeapon(playerid2)));
}
}
}
TextDrawSetString(GPS[playerid],string);
}
TextDrawShowForPlayer(playerid,GPS[playerid]);
}
else
{
gps[playerid] = playerid;
TextDrawHideForPlayer(playerid,GPS[playerid]);
}
}
Код:
C:\Users\Admin\Desktop\TDM11-0.3c.pwn(6289 -- 6290) : error 012: invalid function call, not a valid address C:\Users\Admin\Desktop\TDM11-0.3c.pwn(6290) : error 001: expected token: ";", but found ")" C:\Users\Admin\Desktop\TDM11-0.3c.pwn(6290) : error 029: invalid expression, assumed zero C:\Users\Admin\Desktop\TDM11-0.3c.pwn(6290) : fatal error 107: too many error messages on one line