SA-MP Forums Archive
Countdown - 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: Countdown (/showthread.php?tid=484280)



Countdown - rakshith122 - 30.12.2013

My countdown code
pawn Код:
dcmd_adcountdown(playerid,params[])
{
    new time;
    if(sscanf(params,"u",time))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /adcountdown (time)");
        return 1;
    }
    cdtime = time;
L:5616    SendClientMessageToAll(playerid,COLOR_GREEN,"Administrator has started a countdown");
L:5617    cdtime = time;
    return 1;
}
Errors :
Код:
C:\Users\Bing\Desktop\samp\gamemodes\extremetester.pwn(5616) : error 035: argument type mismatch (argument 2)
C:\Users\Bing\Desktop\samp\gamemodes\extremetester.pwn(5617) : error 017: undefined symbol "cdtime"
C:\Users\Bing\Desktop\samp\gamemodes\extremetester.pwn(5617) : warning 215: expression has no effect
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Help me!


Re: Countdown - [D]ry[D]esert - 30.12.2013

Lets talk about this first:
pawn Код:
SendClientMessageToAll(playerid,COLOR_GREEN,"Administrator has started a countdown");
If you want to send message to all players then why do you need playerid parameter ?
FIX:
pawn Код:
SendClientMessageToAll(COLOR_GREEN,"Administrator has started a countdown");
And about this:
pawn Код:
cdtime = time;
Probably you have not created global variable at the beginning of the gamemode.
FIX:
pawn Код:
new cdtime; // put this at the top of your gamemode, under #include <a_samp.inc>
and also..
why do you use 'u' in sccanf code?
use 'i' or 'd' to represent integers .


Re: Countdown - rakshith122 - 30.12.2013

Thanks!


Re: Countdown - rakshith122 - 30.12.2013

Sorry for the double post.
When I enter /adcount, It says "Administrator has started a countdown" But, Its not counting. Nothing is appearing on my screen.


Re: Countdown - [D]ry[D]esert - 30.12.2013

ya of course because you've to create timer to count down.
Use SetTimer


Re: Countdown - rakshith122 - 30.12.2013

Alright.. Ty.