SA-MP Forums Archive
timer on screen robbery thing - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: timer on screen robbery thing (/showthread.php?tid=422687)



timer on screen robbery thing - master2466 - 14.03.2013

Hey

This might be another stupid question but I'm chaning my dialog box in my script, a dialog box that comes up when you rob whitch makes you unable to move untill its done so I want the timer on the screen, what do I need to do here?

Код:
	            RobbingSchool[i] --;
	        GameTextForPlayer,"Robbing Driving School.\nFinish Robbery in: %d seconds.\nPolice are on the way."
                GameTextForPlayer,"{FF0000}Driving School Robbery"
			}



Re: timer on screen robbery thing - master2466 - 14.03.2013

Hold on I forgot the name of the %d timer at the end


Код:
              RobbingSchool[i] --;
				GameTextForPlayer,"Robbing Driving School.\nFinish Robbery in: %d seconds.\nPolice are on the way.",RobbingSchool[i]);
				GameTextForPlayer,"{FF0000}Driving School Robbery";
I'm tired and I messed around in this for a while now.. please help me out


Re: timer on screen robbery thing - master2466 - 14.03.2013

I realise I have to use it something like :
Quote:

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[18];
format(string, sizeof(string), "Vehicle ID: %i", vehicleid);
GameTextForPlayer(playerid, string, 3000, 1);
return 1;
}

But I don't know how to mix then together without fucking it up.. can't get it made correctly somehow


Re: timer on screen robbery thing - Patrick - 14.03.2013

you need to use format if you're using any variable to count it.

try this
pawn Код:
new string[128];
format(string,sizeof(string),"Robbing Driving School~n~%i Seconds Left",RobbingSchool[i]);
GameTextForPlayer(playerid, string, 1000, 5);



Re: timer on screen robbery thing - master2466 - 14.03.2013

Thanks, I get these though.

Код:
warning 219: local variable "string" shadows a variable at a preceding level
 error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: timer on screen robbery thing - Patrick - 14.03.2013

ohh. you already have a variable of string

remove new string[128];
and
change playerid to i as you are looping it.


Re: timer on screen robbery thing - master2466 - 14.03.2013

Thanks