[Ajuda] comando errado -
Senhor_Azul - 04.05.2012
pawn Код:
if(!strcmp(cmdtext,"/farol",true))
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(GetPVarInt(playerid, "farol"))
{
{
if(luz[playerid] == 1)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_OFF, alar, por, cap, porma, ob);
luz[playerid] = 0;
SendClientMessage(playerid, 0xFFFFFFAA, "Farol {E31919}Desligado!");
}
}
}
}
SetPVarInt(playerid, "farol", false);
{
if(luz[playerid] == 0)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
luz[playerid] = 1;
SendClientMessage(playerid, 0xFFFFFFAA, "Farol {2F991A}Ligado!");
}
}
}
return 1;
}
o que tem de errado com esse comando ?
quando vou compila ele,o pawno para de funcionar.
Valeu ae.
Re: [Ajuda] comando errado -
Kuddy - 04.05.2012
Tente:
pawn Код:
if(!strcmp(cmdtext,"/farol",true))
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(GetPVarInt(playerid, "farol"))
{
{
if(luz[playerid] == 1)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_OFF, alar, por, cap, porma, ob);
luz[playerid] = 0;
SendClientMessage(playerid, 0xFFFFFFAA, "Farol {E31919}Desligado!");
}
}
}
}
SetPVarInt(playerid, "farol", false);
{
if(luz[playerid] == 0)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
luz[playerid] = 1;
SendClientMessage(playerid, 0xFFFFFFAA, "Farol {2F991A}Ligado!");
}
}
return 1;
}
Re: [Ajuda] comando errado -
Senhor_Azul - 04.05.2012
valeu por tentar ajudar.
mas deu a mesma coisa.
#Edit:nao sei se isso ajuda,mas o que eu quero fazer й juntar esse 2 comandos.
pawn Код:
if (strcmp("/farolon", cmdtext, true, 10) == 0)
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(carro != INVALID_VEHICLE_ID)
{
if(luz[playerid] == 0)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
luz[playerid] = 1;
SendClientMessage(playerid, 0xFFFFFFAA, "Farol {2F991A}Ligado!");
}
}
}
if (strcmp("/faroloff", cmdtext, true, 10) == 0)
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(carro != INVALID_VEHICLE_ID)
{
if(luz[playerid] == 1)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_OFF, alar, por, cap, porma, ob);
luz[playerid] = 0;
SendClientMessage(playerid, 0xFFFFFFAA, "Farol {E31919}Desligado!");
}
}
}
Re: [Ajuda] comando errado -
ViniBorn - 04.05.2012
pawn Код:
if(!strcmp(cmdtext,"/farol",true))
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(luz[playerid] == 1)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_OFF, alar, por, cap, porma, ob);
luz[playerid] = 0;
SendClientMessage(playerid, 0xFFFFFFAA, "Farol {E31919}Desligado!");
}
else
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
luz[playerid] = 1;
SendClientMessage(playerid, 0xFFFFFFAA, "Farol {2F991A}Ligado!");
}
return 1;
}
Re: [Ajuda] comando errado -
Senhor_Azul - 04.05.2012
o do vini deu certo,valeu,+rep pra vcs