PDA

View Full Version : timer on screen robbery thing


master2466
14/03/2013, 10:27 PM
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"
}

master2466
14/03/2013, 10:29 PM
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

master2466
14/03/2013, 10:48 PM
I realise I have to use it something like : 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

Patrick
14/03/2013, 10:51 PM
you need to use format if you're using any variable to count it.

try this

new string[128];
format(string,sizeof(string),"Robbing Driving School~n~%i Seconds Left",RobbingSchool[i]);
GameTextForPlayer(playerid, string, 1000, 5);

master2466
14/03/2013, 10:59 PM
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 (c) 1997-2006, ITB CompuPhase


1 Error.

Patrick
14/03/2013, 11:03 PM
ohh. you already have a variable of string

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

master2466
14/03/2013, 11:05 PM
Thanks :)