CMD:ecountdown(playerid,params[]) //Starts a countdown, after the countdown the Doors will be locked. (There is no command yet to unlock the doors).
{
if(countTimer != -1) return SendClientMessage(playerid, RED, "ERROR: Countdown is already enabled.");
if(!params[0]) return SendClientMessage(playerid, 0xFF0055FF, "Type in a time.");
if(status) return SendClientMessage(playerid, 0xFF0000FF, "Error: Nicht unlocked.");
new time = strval(params);
if(time < 10 || time > 500) return SendClientMessage(playerid, RED, "Type in a time from 10 to 500..");
countTimer = SetTimerEx("CountDownObjekte", 1000, false, "dd", playerid, time);
return 1;
}
forward CountDownObjekte(playerid, count);
public CountDownObjekte(playerid, count)
{
count--;
if(count <= 0)
{
KillTimer(countTimer);
countTimer = -1;
for(new i=0; i<MAX_PLAYERS; i++) PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0); //GO - Sound
gObj[0] = CreateObject(1498,1866.485,-2496.830,5047.411,0.000,0.000,36.199,300.000);
SetObjectMaterial( gObj[0], 0, 5150, "wiresetc_las2", "ganggraf01_LA_m", 0);
SetObjectMaterialText(gObj[0], "LOCKED", 0, 50, "Calibri", 15, 1, -65536, 0, 1);
gObj[1] = CreateObject(1498,1841.824,-2495.508,5047.339,0.000,0.000,335.900,300.000);
SetObjectMaterial( gObj[1], 0, 5150, "wiresetc_las2", "ganggraf01_LA_m", 0);
SetObjectMaterialText(gObj[1], "LOCKED", 0, 50, "Calibri", 15, 1, -65536, 0, 1);
GameTextForAll( "Go!" , 1000, 3 );
status = true;
return 1;
}
new str[16];
format(str, sizeof(str), "%d", count);
GameTextForAll( str, 5000, 4 );
for(new i=0; i<MAX_PLAYERS; i++) PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0); //Timer - Sound
countTimer = SetTimerEx("CountDownObjekte", 1000, false, "dd", playerid, count);
return 1;
}
Alles anzeigen
Und die Deklaration:
Versuche es dann so.