SA-MP Forums Archive
help me please - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help me please (/showthread.php?tid=158563)



help me please - iJumbo - 10.07.2010

i have this command and work fine
pawn Код:
if (strcmp(cmd, "/count", true) == 0)
    {
    if(GetPVarInt(playerid,"CMDABUSE")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"wait 5 second");
    SetPVarInt(playerid,"CMDABUSE",GetTickCount()+5000);
    ccd1();
    new string[256], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "countdown started by %s", pname);
    SendClientMessageToAll(0x33CCFFAA, string);
    return 1;
}
and the public
pawn Код:
public ccd1()
{
GameTextForAll("~y~3", 500, 4);
SetTimer("ccd2", 900, 0);
}

public ccd2()
{
GameTextForAll("~r~2", 500, 4);
SetTimer("ccd3", 900, 0);
}

public ccd3()
{
GameTextForAll("~r~1", 500, 4);
SetTimer("ccd4", 900, 0);
}

public ccd4()
{
GameTextForAll("~y~]] ~r~GO ~y~]]", 1000, 4);
}
how i can make when one player type /count a other player recive "you cant start it is already started" help plz some player spawn it in my server


Re: help me please - willsuckformoney - 10.07.2010

did you forward the ccd1 ccd2 ccd3 ccd4 ?? did you make the timer under gamemodeinit or filterscriptinit? did you set timer in onplayerconnect?! if not then thats it


Re: help me please - DeathOnaStick - 10.07.2010

Quote:
Originally Posted by willsuckformoney
Посмотреть сообщение
did you forward the ccd1 ccd2 ccd3 ccd4 ?? did you make the timer under gamemodeinit or filterscriptinit? did you set timer in onplayerconnect?! if not then thats it
I don't think this will solve it, if i understood your question correctly.

Do you mean that when one player types /count, a second player cannot start the countdown?
If yes, then you should create a global variable, e.g. 'new CountCalled=0;'.
Then you should set it to 1 when the command is called and to 0 when the timer finished.

Cheers.


Re: help me please - iJumbo - 10.07.2010

yea thx DeathOnaStick


Re: help me please - iJumbo - 10.07.2010

i maked this
pawn Код:
if (strcmp(cmd, "/count", true) == 0)
    {
    if(CountCalled = 0)
    {
    if(GetPVarInt(playerid,"CMDABUSE")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"devi aspettare per rifare il comando");
    SetPVarInt(playerid,"CMDABUSE",GetTickCount()+5000);
    ccd1();
    new string[256], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "countdown startato da %s", pname);
    SendClientMessageToAll(0x33CCFFAA, string);
    printf("[CMD] %s ha usato il comando /count", pname);
    CountCalled = 1;
    }
    if(CountCalled = 1)
    {
    SendClientMessageToAll(0x33CCFFAA,"non puoi startare il conto и gia partito");
    }
    return 1;
}
pawn Код:
public ccd1()
{
GameTextForAll("~y~3", 500, 4);
SetTimer("ccd2", 900, 0);
}

public ccd2()
{
GameTextForAll("~r~2", 500, 4);
SetTimer("ccd3", 900, 0);
}

public ccd3()
{
GameTextForAll("~r~1", 500, 4);
SetTimer("ccd4", 900, 0);
}

public ccd4()
{
GameTextForAll("~y~]] ~r~GO ~y~]]", 1000, 4);
CountCalled = 0;
}
can work fine?


Re: help me please - Cameltoe - 10.07.2010

pawn Код:
new IsCount = 0;

if (strcmp(cmd, "/count", true) == 0)
    {
    if(IsCount == 0)
    {
    if(GetPVarInt(playerid,"CMDABUSE")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"devi aspettare per rifare il comando");
    SetPVarInt(playerid,"CMDABUSE",GetTickCount()+5000);
    ccd1();
    new string[256], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "countdown startato da %s", pname);
    SendClientMessageToAll(0x33CCFFAA, string);
    printf("[CMD] %s ha usato il comando /count", pname);
    IsCount = 1;
    }
    if(IsCount == 1)
    {
    SendClientMessageToAll(0x33CCFFAA,"non puoi startare il conto и gia partito");
    }
    return 1;
}