PDA

View Full Version : [AJUDA]GPS


Victor_Souz4
30/11/2011, 04:31 PM
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)+floatpowe r(floatabs(floatsub(idZ,pZ)),2));
if(IsPlayerConnected(playerid2))
{
for(new i = 0; i < MAX_PLAYERS; i++) if(i != playerid2 && i != playerid) SetPlayerMarkerForPlayer(playerid,i,(GetPlayerColo r(i) & 0xFFFFFF00) | 0x00000011);
SetPlayerMarkerForPlayer(playerid,playerid2,GetPla yerColor(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(Distanc e),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(Distanc e),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(Distanc e),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(Distanc e),CityInGps[i][CITYNAME],floatround(Vida),floatround(Colete),weaponNames(G etPlayerWeapon(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(Distanc e),CityInGps[i][CITYNAME],floatround(Vida),floatround(Colete),weaponNames(G etPlayerWeapon(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(Ge tPlayerWeapon(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(Ge tPlayerWeapon(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

Lós
30/11/2011, 04:35 PM
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)+floatpowe r(floatabs(floatsub(idZ,pZ)),2));
if(IsPlayerConnected(playerid2))
{
for(new i = 0; i < MAX_PLAYERS; i++) if(i != playerid2 && i != playerid) SetPlayerMarkerForPlayer(playerid,i,(GetPlayerColo r(i) & 0xFFFFFF00) | 0x00000011);
SetPlayerMarkerForPlayer(playerid,playerid2,GetPla yerColor(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(Distanc e),CityInGps[i][CITYNAME]);
}
else
{
if(GetPlayerWeapon(playerid2)==0)
{
if(IsPlayerInAnyVehicle(playerid2))
{
format(string, sizeof(string), "~r~%s (id:%d)~n~~g~%d Metros %s~n~~r~Vida:%d Colete:%d~n~~b~Sem Arma %s", PlayerName(playerid2),playerid2,floatround(Distanc e),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(Distanc e),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(Distanc e),CityInGps[i][CITYNAME],floatround(Vida),floatround(Colete),weaponNames(G etPlayerWeapon(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(Distanc e),CityInGps[i][CITYNAME],floatround(Vida),floatround(Colete),weaponNames(G etPlayerWeapon(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(Ge tPlayerWeapon(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(Ge tPlayerWeapon(playerid2)));
}
}
}
TextDrawSetString(GPS[playerid],string);
}
TextDrawShowForPlayer(playerid,GPS[playerid]);
}
else
{
gps[playerid] = playerid;
TextDrawHideForPlayer(playerid,GPS[playerid]);
}
}

Victor_Souz4
30/11/2011, 04:43 PM
Mesmos erros -.-

Lós
30/11/2011, 04:45 PM
Afinal, quais linhas estão dando erro que não consegui identificar?

Victor_Souz4
30/11/2011, 04:56 PM
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(Distan ce),CityInGps[i][CITYNAME],floatround(Vida),floatround(Colete),weaponNames(G etPlayerWeapon(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(Distan ce),CityInGps[i][CITYNAME],floatround(Vida),floatround(Colete),weaponNames(G etPlayerWeapon(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(pla yerid2)),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(pla yerid2)));
}
}
}

Todas as linhas que estao em format ..

Victor_Souz4
30/11/2011, 07:03 PM
HELP PLIS