SA-MP Forums Archive
[AJUDA] Veiculo Vip - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] Veiculo Vip (/showthread.php?tid=297281)



[AJUDA] Veiculo Vip - Leo_Lost - 15.11.2011

Achei um CMD de localizar veiculo vip mas nгo deu este erro , error 032: array index out of bounds (variable "CarInfo").Gostaria de Saber oque pode causar este erro.


Quote:

}
if(strcmp(cmd, "/veiculolocalizar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pCarKey] == 0)
{
SetPlayerCheckpoint(playerid, CarInfo[pCarKey][cPos_X],CarInfo[pCarKey][cPos_Y],CarInfo[pCarKey][cPos_Z], 9.0);
GameTextForPlayer(playerid, "~r~Veiculo Vip Marcado!", 5000, 1);
}
else
{
GameTextForPlayer(playerid, "~w~Voce nao tem um Veiculo Vip", 5000, 1);
}
}
return 1;
}




Re: [AJUDA] Veiculo Vip - Pharrel - 15.11.2011

mostra a enum do Car Info.

@edit ah... achei o problema.
pawn Код:
new carkey = PlayerInfo[playerid][pCarKey];
SetPlayerCheckpoint(playerid, CarInfo[carkey][cPos_X],CarInfo[carkey][cPos_Y],CarInfo[carkey][cPos_Z], 9.0);



Re: [AJUDA] Veiculo Vip - Leo_Lost - 15.11.2011

O cmd nao ta funcionando nao queria pedir se alguem sabe de algum comando pra localizar veiculo vip,obrigado.


Re: [AJUDA] Veiculo Vip - Pharrel - 15.11.2011

pawn Код:
if(!strcmp("/veiculolocalizar",cmdtext, true))
{
    new id, Float:Pharrel[3], str[30];
    if(unformat(params, "s[30]i", str[30], id)) return SendClientMessage(playerid, -1, "Use: /encontrarcarro [ID DO CARRO]");
    GetVehiclePos(id, pharrel[0], pharrel[1], pharrel[2]);
    SetVehicleCheckpoint(playerid, pharrel[0], pharrel[1], pharrel[2], 10.0);
    return GameTextForPlayer(playerid, "~r~Veiculo Vip Marcado!", 5000, 1);
}
//com a variavel do veiculo q vc postou acima.
if(!strcmp("/veiculolocalizar",cmdtext, true))
{
    new Float:Pharrel[3];
    if(PlayerInfo[playerid][pCarKey] == 0) return SendClientMessage(playerid, -1, "vc n tem carro");
    GetVehiclePos(PlayerInfo[playerid][pCarKey], pharrel[0], pharrel[1], pharrel[2]);
    SetVehicleCheckpoint(playerid, pharrel[0], pharrel[1], pharrel[2], 10.0);
    return GameTextForPlayer(playerid, "~r~Veiculo Vip Marcado!", 5000, 1);
}
//nesse n precisa do sscanf
Vai precisar do plugin SSCANF2.