Countdown
#1

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!
Reply
#2

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 .
Reply
#3

Thanks!
Reply
#4

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.
Reply
#5

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

Alright.. Ty.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)