Jump to content
  • 0

Cum setez timpul la 0 la /eventchat


Question

Posted

Problema intalnita (descriere): Cum pot seta timpul la 0 la /eventchat , /e , imi apare sa astept 2000 secunde..
Ero(area / rile) / warning-(ul / urile): In poza.
Liniile de cod / sursa / script-ul(obligatoriu):

    if(strcmp(cmd, "/e", true) == 0 || strcmp(cmd, "/eventchat", true) == 0)

{
   if(IsPlayerConnected(playerid))
   {
       if(gPlayerLogged[playerid] == 0)
       {
           SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet !");
           return 1;
       }
       if(PlayerInfo[playerid][pLevel] < 4)
       {
          SendClientMessage(playerid, COLOR_LIGHTGREEN, "   Ai nevoie de level 4 sa poti folosi aceasta comanda !");
           return 1;
       }
       if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "   Nu poti vorbi, ai mute !!");
return 1;
}
if(PlayerTied[playerid] > 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "  You can`t use this command because you are tied!");
                return 1;
            }
if(Event7[playerid] == 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: (/e)vent [text]");
return 1;
}
if(EventChat[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "   You already sent 3 messages.");
return 1;
}
if (!ec)
{
format(string, sizeof(string), "   Please try again later, %d seconds between Event Informations !",  (eventtimer/60));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
}
EventChat[playerid] -= 1;
format(string, sizeof(string), "{6699FF}[Organizator Event] %s : %s", sendername, result);
SendClientMessageToAll(COLOR_ORANGE,string);
SetTimer("EcOn", eventtimer, 60);
ec = 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "   Nu ai un event activ.");
return 1;
}
}
return 1;
}

Imagini / Video (optional): http://imgur.com/erUjtPu
Ati incercat sa rezolvati singur?: Da, dar tot asa apare, SI DACA POT INTREBA INCA UN LUCRU , daca nu doar la aceea cu /eventchat, cum pot face interioare hq la factiuni, adica sa fac un hq(nu spawn-ul) sa pot intra in el.

350x20_FFFFFF_FFFFFF_000000_000000.png

12 answers to this question

Recommended Posts

  • 0
Posted

Treci toate functiile din callback-ul "EcOn" in comanda si stergi  "SetTimer("EcOn", eventtimer, 60);".

Daca nu te descurci lasa-mi callback-ul "EcOn" (public EcOn).

Ocupation: Youtube, Mined Bitcoin's, Scripting & Mapping SA:MP

  • 0
Posted

Nu prea ma descurc , uite ce mi-ai zis sa-ti dau

public EcOn()

{
    ec=1;
    return 1;
}
 
public Encript(string[])
{
for(new x=0; x < strlen(string); x++)
 {
 string[x] += (3^x) * (x % 15);
 if(string[x] > (0xff))
 {
 string[x] -= 256;
 }
 }
return 1;
}
 
stock fcopy(oldname[],newname[])
{
new File:ohnd,File:nhnd;
if (!fexist(oldname))
{
return 0;
}
ohnd=fopen(oldname,io_read);
nhnd=fopen(newname,io_write);
new buf2[1];
for (new i=flength(ohnd);i>0;i--)
{
fputchar(nhnd, fgetchar(ohnd, buf2[0],false),false);
}
fclose(ohnd);
fclose(nhnd);
return 1;
}
 
stock frename(oldname[],newname[])
{
if (!fexist(oldname))
{
return 0;
}
fremove(newname);
if (!fcopy(oldname,newname))
{
return 0;
}
fremove(oldname);
return 1;
}

350x20_FFFFFF_FFFFFF_000000_000000.png

  • 0
Posted (edited)

Nu prea inteleg ce este cu acel timer acolo, si nici cu acel "!ec", dar incearca asa:

if(strcmp(cmd, "/e", true) == 0 || strcmp(cmd, "/eventchat", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
return 1;
}
if(PlayerInfo[playerid][pLevel] < 4)
{
SendClientMessage(playerid, COLOR_LIGHTGREEN, " Ai nevoie de level 4 sa poti folosi aceasta comanda !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, " Nu poti vorbi, ai mute !!");
return 1;
}
if(PlayerTied[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "  You can`t use this command because you are tied!");
return 1;
}
if(Event7[playerid] == 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: (/e)vent [text]");
return 1;
}
if(EventChat[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You already sent 3 messages.");
return 1;
}
EventChat[playerid] -= 1;
format(string, sizeof(string), "{6699FF}[Organizator Event] %s : %s", sendername, result);
SendClientMessageToAll(COLOR_ORANGE,string);
ec = 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nu ai un event activ.");
return 1;
}
}
}
return 1;
}
Edited by #Teddy

Ocupation: Youtube, Mined Bitcoin's, Scripting & Mapping SA:MP

  • 0
Posted (edited)

Greseala mea, mi-a scapat o paranteza, poftim:

if(strcmp(cmd, "/e", true) == 0 || strcmp(cmd, "/eventchat", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
return 1;
}
if(PlayerInfo[playerid][pLevel] < 4)
{
SendClientMessage(playerid, COLOR_LIGHTGREEN, " Ai nevoie de level 4 sa poti folosi aceasta comanda !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, " Nu poti vorbi, ai mute !!");
return 1;
}
if(PlayerTied[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "  You can`t use this command because you are tied!");
return 1;
}
if(Event7[playerid] == 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: (/e)vent [text]");
return 1;
}
if(EventChat[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You already sent 3 messages.");
return 1;
}
EventChat[playerid] -= 1;
format(string, sizeof(string), "{6699FF}[Organizator Event] %s : %s", sendername, result);
SendClientMessageToAll(COLOR_ORANGE,string);
ec = 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nu ai un event activ.");
return 1;
}
}
return 1;
}
Edited by #Teddy

Ocupation: Youtube, Mined Bitcoin's, Scripting & Mapping SA:MP

  • 0
Posted
if(strcmp(cmd, "/e", true) == 0 || strcmp(cmd, "/eventchat", true) == 0)
{
 if(IsPlayerConnected(playerid))
 {
 if(gPlayerLogged[playerid] == 0)
 {
 SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
 return 1;
 }
 if(PlayerInfo[playerid][pLevel] < 4)
 {
  SendClientMessage(playerid, COLOR_LIGHTGREEN, " Ai nevoie de level 4 sa poti folosi aceasta comanda !");
 return 1;
 }
 if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, " Nu poti vorbi, ai mute !!");
return 1;
}
if(PlayerTied[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "  You can`t use this command because you are tied!");
return 1;
}
if(Event7[playerid] == 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: (/e)vent [text]");
return 1;
}
if(EventChat[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You already sent 3 messages.");
return 1;
}
if (!ec)
{
format(string, sizeof(string), " Please try again later, %d seconds between Event Informations !",  (eventtimer/60));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
}
EventChat[playerid] -= 1;
format(string, sizeof(string), "{6699FF}[Organizator Event] %s : %s", sendername, result);
SendClientMessageToAll(COLOR_ORANGE,string);
ec = 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nu ai un event activ.");
return 1;
}
}
return 1;
}
  • 0
Posted (edited)

Copiaza codul calumea, in poza observ ca ai uitat o paranteza acolo la "if(PlayerTied[playerid] > 0)"

(mai exact cea de inchidere "}") si nici nu este codul care ti l-am dat eu.

Edited by #Teddy

Ocupation: Youtube, Mined Bitcoin's, Scripting & Mapping SA:MP

  • 0
Posted

Multumesc tarzanus ! Poate cineva sa-mi spuna cum pot adauga hq-uri la factiuni, adica sa poti intra in ele, un tutorial ceva..

350x20_FFFFFF_FFFFFF_000000_000000.png

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.