Function problem
#1

I made a little service and it doesn't work. It freezes me and repairs my car but it doesn't unfreeze me.
Код:
public ReparaMasina(playerid)
{
	TogglePlayerControllable(playerid,1);
	SCM(playerid, COLOR_LIGHTBLUE, "Masina a fost reparata. Poti pleca acum!");
	return 1;
}
Код:
if(!strcmp(cmdtext, "/rc", true))
{
	SCM(playerid, COLOR_LIGHTBLUE, "Masina se va repara in 30 de secunde.");
	GivePlayerMoney(playerid, -500);
	RepairVehicle(GetPlayerVehicleID(playerid));
	TogglePlayerControllable(playerid,0);
	SetTimer("ReparaMasina", 30 * 1000,0);
	return 1;
}
Reply
#2

That's because you're not passing a playerid to the function at all, therefore it won't work as you're intending, Pawn isn't a mindreader! You must tell it what the ID is. For example:

pawn Код:
SetTimerEx("ReparaMasina", 30 * 1000,0,"i",playerid);
Reply
#3

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)