[Ajuda] Podem me dar dicas aqui?
#1

Olб pessoal, num code de /freio, estгo dando 2 erros e 2 warnings, que sгo os seguintes:

Код:
C:\DOCUME~1\Conta\Desktop\GMON\FILTER~1\freio.pwn(325) : error 076: syntax error in the expression, or invalid function call
C:\DOCUME~1\Conta\Desktop\GMON\FILTER~1\freio.pwn(326) : error 035: argument type mismatch (argument 2)
C:\DOCUME~1\Conta\Desktop\GMON\FILTER~1\freio.pwn(328) : warning 202: number of arguments does not match definition
C:\DOCUME~1\Conta\Desktop\GMON\FILTER~1\freio.pwn(328) : warning 202: number of arguments does not match definition
Os erros estгo numa callback que eu botei para quando o freio for ativado ficar botando o carro toda hora na mesma posiзгo, e quando o freio for desativado й matado pelo KillTimer...

Topo do GM:

Код:
new Float: X[MAX_VEHICLES], Float:Y[MAX_VEHICLES], Float:Z[MAX_VEHICLES];
forward FreioUsado();
Quando o freio й ativado:

Код:
TirarFreio[vehicleid] = SetTimerEx("FreioUsado", 1, true, "i", vehicleid);
Quando й desativado:

Код:
KillTimer(TirarFreio[vehicleid]);
callback FreioUsado(Erros e Warnings marcados de vermelho):

Код:
public FreioUsado()
{
	new vehicleid = GetPlayerVehicleID;
	new pegarpos = GetVehiclePos(vehicleid, X, Y, Z);
	{
	    SetVehiclePos(vehicleid, pegarpos);
	}
}
Alguйm pode me dar uma dica do que fazer?
Reply
#2

mas qual linhas exatamente ta tendo o erro?
Reply
#3

pawn Код:
public FreioUsado()
{
    new vehicleid = GetPlayerVehicleID;
    new Float:P[2];
    {
            GetVehiclePos(vehicleid, P[0], P[1], P[2]);
        SetVehiclePos(vehicleid, P[0], P[1], P[2]);
    }
}
Reply
#4

Quote:
Originally Posted by Coe1
Посмотреть сообщение
pawn Код:
public FreioUsado()
{
    new vehicleid = GetPlayerVehicleID;
    new Float:P[2];
    {
            GetVehiclePos(vehicleid, P[0], P[1], P[2]);
        SetVehiclePos(vehicleid, P[0], P[1], P[2]);
    }
}
que isso?

olha { e} a mais e sao 3 pos n 2

pawn Код:
public FreioUsado(playerid)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new Float:P[3];
    GetVehiclePos(vehicleid, P[0], P[1], P[2]);
    SetVehiclePos(vehicleid, P[0], P[1], P[2]);
    return 1;
}
Reply
#5

Quote:
Originally Posted by PT
Посмотреть сообщение
que isso?

olha { e} a mais e sao 3 pos n 2

pawn Код:
public FreioUsado(playerid)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new Float:P[3];
    GetVehiclePos(vehicleid, P[0], P[1], P[2]);
    SetVehiclePos(vehicleid, P[0], P[1], P[2]);
    return 1;
}
Funcinou man mas tenho outra dъvida, no SetTimerEx eu quero que fiquem repetiзхes infinitas botando o carro do mesmo lugar, mas sу ta fazendo 1 vez :S, como faзo pra botar infinito?
Reply
#6

https://sampwiki.blast.hk/wiki/SetTimerEx

Exemplo

SetTimerEx("EndAntiSpawnKill", 5000, true, "i", playerid);
Reply
#7

Quote:
Originally Posted by Kuddy
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/SetTimerEx

Exemplo

SetTimerEx("EndAntiSpawnKill", 5000, true, "i", playerid);
Eu coloquei true, mas quando uso o comando /freio nгo acontece nada, aparece SERVER: UNKNOW COMMAND
Serб que й da callback que o PT me deu? Ou o comando? Olha ai:

Код:
if(strcmp(cmdtext, "/freio", true) == 0)
	{
	    for(new i = 0; i < MAX_PLAYERS; i++)
	    {
		new vehicleid = GetPlayerVehicleID(playerid);
		if(Engine[vehicleid] == 1)
		{
			if(Freio[vehicleid] == 0)
			{
				SendClientMessage(playerid, COLOR_LIGHTRED, "Freio de Mгo Desativado.");
				format(string, sizeof(string), "*%s Tira o freio de mгo.", sendername);
				ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				Freio[vehicleid] = 1;
			 	KillTimer(TirarFreio[vehicleid]);
			}
			else if(Freio[vehicleid] == 1)
			{
				SendClientMessage(playerid, COLOR_LIGHTRED, "Freio de Mгo Ativado.");
				format(string, sizeof(string), "*%s Puxa o freio de mгo.", sendername);
				ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				Freio[vehicleid] = 0;
				TirarFreio[vehicleid] = SetTimerEx("FreioUsado", 100, true, "i", vehicleid);
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_LIGHTRED, "Ligue o veiculo antes de mexer no freio de mгo!.");
		}
	}
	return 1;
}
Код:
public FreioUsado(playerid)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new Float:P[3];
    GetVehiclePos(vehicleid, P[0], P[1], P[2]);
    SetVehiclePos(vehicleid, P[0], P[1], P[2]);
    return 1;
}
Enfim o objetivo й ficar setando o carro para a mesma posiзгo onde foi dado /freio vбrias vezes, atй que o player use /freio denovo e quebre esse SetTimerEx com KillTimer
Reply
#8

return 0;
na chave de fechamento da Looping.
Reply
#9

e o comando

olha isto


https://sampforum.blast.hk/showthread.php?tid=153224
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)