[Ayuda] /encontrarveh - 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: Español/Spanish (
https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: [Ayuda] /encontrarveh (
/showthread.php?tid=274751)
[Ayuda] /encontrarveh -
ermakiloko - 07.08.2011
Hola, mirar tengo un problema, tengo un comando de encontrar vehнculos, pero claro, me pire que ponga /encontrarveh y la matrнcula del vehнculo, pero me gustarнa que fuese de la siguiente manera, /encontrarveh [ID del jugador] que pusieses el comando y en vez de la matrнcula pondrнas la ID del jugador y apareceria su coche en el mapa.
Gracias.
Comando
Код:
if(strcmp(cmd, "/encontrarveh", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!ESI(playerid)) return Message(playerid, COLOR_GRAD2, "No perteneces a esta organizaciуn!");
{
}
if(PlayerOnMission[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " On a mission right now, can't use this command !");
return 1;
}
if(UsedFind[playerid] != 0 && PlayerInfo[playerid][pDetSkill] < 401)
{
SendClientMessage(playerid, COLOR_GREY, "El Satelite ESI se encuentra cargando archivos espera 1 minuto!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /EncontrarVeh [ID]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = strval(tmp);
if(plo < 1 || plo > TOTAL_VEH) { SendClientMessage(playerid, COLOR_GREY, "ID Erroneo!"); return 1; }
{
GetVehiclePos(plo, plocx, plocy, plocz);
SetPlayerCheckpoint(playerid,plocx,plocy, plocz, 6.0);
PlayerInfo[playerid][pDetSkill] ++;
UsedFind[playerid] = 1;
}
}
return 1;
}
Respuesta: [Ayuda] /encontrarveh -
M1tux3r - 07.08.2011
Si utilizas
pPcarkey, para la llave del vehнculo.
Код:
if(strcmp(cmd, "/encontrarveh", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!ESI(playerid)) return Message(playerid, COLOR_GRAD2, "No perteneces a esta organizaciуn!");
if(PlayerOnMission[playerid] > 0) return SendClientMessage(playerid, COLOR_GREY, " On a mission right now, can't use this command !");
if(UsedFind[playerid] != 0 && PlayerInfo[playerid][pDetSkill] < 401) return SendClientMessage(playerid, COLOR_GREY, "El Satelite ESI se encuentra cargando archivos espera 1 minuto!");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USO: /EncontrarVeh [ID jugador]");
new jugador = strval(tmp);
if(!IsPlayerConnected(jugador )) return 1;
if(jugador == INVALID_PLAYER_ID) return 1;
new coche = PlayerInfo[jugador][pPcarkey], Float:Pos[3];
GetVehiclePos(coche, Pos[0], Pos[1], Pos[2]);
SetPlayerCheckpoint(playerid, Pos[0], Pos[1], Pos[2], 6.0);
PlayerInfo[playerid][pDetSkill] ++;
UsedFind[playerid] = 1;
}
return 1;
}
Si utilizas uno diferente. cambia new coche = PlayerInfo[jugador][
Loqueutilizes];
Re: [Ayuda] /encontrarveh -
ermakiloko - 07.08.2011
Muchas gracias por tu ayuda, me a servido (:
Saludos.
Cierro tema.