їQuй estб mal con este cуdigo? -
RicardoMaia - 21.01.2014
Cuando el jugador entra en el vehнculo el pestillo de reloj, mбs cуdigo OnPlayerEnterVehicle pъblico no estб mal.
public "reloginho":
pawn Код:
public reloginho(){
SyncTime();
new
string[256],
ano,
mes,
dia,
horas,
minutos,
segundos;
getdate(ano, mes, dia);gettime(horas, minutos, segundos);
format(string, sizeof string, "~b~~h~~h~~h~%d/%s%d/2014", dia, ((mes < 10) ? ("0") : ("")), mes);TextDrawSetString(Reloginho1, string);
format(string, sizeof string, "~b~~h~~h~~h~%s%d:%s%d:%s%d", (horas < 10) ? ("0") : (""), horas, (minutos < 10) ? ("0") : (""), minutos, (segundos < 10) ? ("0") : (""), segundos);TextDrawSetString(Reloginho2, string);
TextDrawShowForAll(Reloginho1);TextDrawShowForAll(Reloginho2);}
public OnPlayerEnterVehicle:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[256];
new strong[256];
if(IsAnOwnableCar(vehicleid) && CarInfo[vehicleid][cLock] == 1 && CarInfo[vehicleid][cOwned] == 1)
{
if(IsPlayerAdmin(playerid)) { }
else
{
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
GetPlayerName(playerid, sendernome, sizeof(sendernome));
format(strong, sizeof(strong), "* %s Puxa a maзaneta do veнculo de %s sem sucesso.", sendernome, CarInfo[vehicleid][cOwner]);
ProxDetector(5.0, playerid, strong, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "[INFO]: Este veнculo estб trancado!");
}
}
if(CarInfo[vehicleid][cLock] == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s Entra no veiculo.", sendername);
ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
if(Trancado[vehicleid] >= 1)
{
if(PlayerInfo[playerid][pAdmin] > 0 || ispassenger) { }
else
{
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
SetPlayerPos(playerid, x, y, z+0.3);
SetPlayerFacingAngle(playerid, a);
SendClientMessage(playerid, COLOR_YELLOW, "Veiculo Trancado!");
}
}
return true;
}
Respuesta: їQuй estб mal con este cуdigo? -
Jovazxc - 21.01.2014
No dices cual es el problema, por cierto, el portuguйs tiene su propia secciуn, te recomiendo ir ahн
Vocк nгo diz qual й o problema, й claro, o Portuguкs tem sua prуpria seзгo, eu recomendo a minha viagem
http://forum.sa-mp.com/forumdisplay.php?f=34
Usa las tabulaciones y tu cуdigo serб mas comprensible
Use as guias e seu cуdigo serб mais compreensнvel
Le hice unos cambios, pruebalo
Eu fiz algumas mudanзas, experimentб-lo
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[256];
new strong[256];
if(IsAnOwnableCar(vehicleid) && CarInfo[vehicleid][cLock] == 1 && CarInfo[vehicleid][cOwned] == 1)
{
if(!IsPlayerAdmin(playerid)) // Si no es administrador
{
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
GetPlayerName(playerid, sendernome, sizeof(sendernome));
format(strong, sizeof(strong), "* %s Puxa a maзaneta do veнculo de %s sem sucesso.", sendernome, CarInfo[vehicleid][cOwner]);
ProxDetector(5.0, playerid, strong, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "[INFO]: Este veнculo estб trancado!");
}
}
if(CarInfo[vehicleid][cLock] == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s Entra no veiculo.", sendername);
ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
if(Trancado[vehicleid] >= 1)
{
if(PlayerInfo[playerid][pAdmin] == 0 || ispassenger)
{
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
SetPlayerPos(playerid, x, y, z+0.3);
SetPlayerFacingAngle(playerid, a);
SendClientMessage(playerid, COLOR_YELLOW, "Veiculo Trancado!");
}
}
return 1;
}