if(strcmp(cmd, "/oglas", true) == 0 || strcmp(cmd, "/oglas", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "Neste logirani !");
return 1;
}
if(PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_YELLOW, "Mora da ste level 3 za da pisuvate oglas !");
return 1;
}
if(!PlayerToPoint(10.0,playerid,-2239.4780,130.4675,1035.4141))
{
SendClientMessage(playerid, COLOR_YELLOW, "Neste vo Oglasnik !");
return 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_RED, "Koristi: /oglas [ text]");
return 1;
}
if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
{
format(string, sizeof(string), "{FF0000}GRESKA:{FFFFFF}Ve molime pocekajte 10 sekundi za da napisete oglas.", (addtimer/10000));
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
new payout = idx * 200;
if(GetPlayerMoney(playerid) < payout)
{
format(string, sizeof(string), "Iskoristivte %d Bukvi koj cinat $%d, Nemate dovolno.", offset, payout);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
GivePlayerMoney(playerid, - payout);
SBizzInfo[7][sbTill] += payout;
ExtortionSBiz(7, payout);
format(string, sizeof(string), "{37F906}[OGLAS]: %s,{F3FF02}Kontakt: %s Mobilen: %d", result, sendername, PlayerInfo[playerid][pPnumber]);
OOCNews(TEAM_GROVE_COLOR,string);
format(string, sizeof(string), "~r~Plativte $%d~n~~w~Poraka se sostoi od: %d Bukvi", payout, idx);
GameTextForPlayer(playerid, string, 5000, 1);
if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
}
return 1;
}
if(GetTickCount()-SyncCD[playerid]<2800)return 0;
stock Sync(playerid)
{
if(GetTickCount()-SyncCD[playerid]<2800)return 0; //If the TickCount isnt finished it wont do anything
else
{
//DoSomethingHere
return 1;
}
Try with GetTickCount, for example:
PHP код:
Do it like this: PHP код:
If you still dont know how to do it let me know |
SetTimerEx("<TimerName>", <time (1s is 1000)>, <boolean(can be called multiple times)>, "i", playerid<playerthatgetsthis>);
forward <TimerName>(playerid); public <TimerName>(playerid); { // insert code here that you want to put, this code appears after the timer has passed, so SendClientMessage(playerid, -1, "The timer has passed and you may report once more!.");
new PlayerHasReported[MAX_PLAYERS]; // this is just a thing that indicates if the player has reported
if(PlayerHasReported[playerid] == 1) // this gets if the player has /report'ed in the last 10 seconds { SendClientMessage(playerid, COLOR_GREY, " Wait 10 seconds after sending a next report ! "); // self explainatory return 1; } // code here SetTimerEx("ReportReset", 10000, false, "i", playerid); // timer that stops you from reporting again in 10 seconds PlayerHasReported[playerid] = 1; // this is to say that they have reported in the last 10 seconds
forward ReportReset(playerid); public ReportReset(playerid) { if(IsPlayerConnected(playerid)) // checks if player is connected { if(PlayerHasReported[playerid] == 1) PlayerHasReported[playerid] = 0; // if player's 10 seconds cooldown is over then it allows them to report again } }
if(strcmp(cmd, "/oglas", true) == 0 || strcmp(cmd, "/oglas", true) == 0) { if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_YELLOW, "Neste logirani !"); return 1; } if(PlayerInfo[playerid][pLevel] < 3) { SendClientMessage(playerid, COLOR_YELLOW, "Mora da ste level 3 za da pisuvate oglas !"); return 1; } if(!PlayerToPoint(10.0,playerid,-2239.4780,130.4675,1035.4141)) { SendClientMessage(playerid, COLOR_YELLOW, "Neste vo Oglasnik !"); return 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_RED, "Koristi: /oglas [ text]"); return 1; } if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))[/COLOR]) { format(string, sizeof(string), "{FF0000}GRESKA:{FFFFFF}Ve molime pocekajte 10 sekundi za da napisete oglas.", (addtimer/10000)); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } new payout = idx * 200; if(GetPlayerMoney(playerid) < payout) { format(string, sizeof(string), "Iskoristivte %d Bukvi koj cinat $%d, Nemate dovolno.", offset, payout); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } GivePlayerMoney(playerid, - payout); SBizzInfo[7][sbTill] += payout; ExtortionSBiz(7, payout); format(string, sizeof(string), "{37F906}[OGLAS]: %s,{F3FF02}Kontakt: %s Mobilen: %d", result, sendername, PlayerInfo[playerid][pPnumber]); OOCNews(TEAM_GROVE_COLOR,string); format(string, sizeof(string), "~r~Plativte $%d~n~~w~Poraka se sostoi od: %d Bukvi", payout, idx); GameTextForPlayer(playerid, string, 5000, 1); if (PlayerInfo[playerid][pAdmin] < 1); SetTimerEx("AddsReset", 30000, false, "i", playerid); } return 1; } forward AddsReset(playerid) public AddsReset(playerid) { if(IsPlayerConnected(playerid)) { if(adds[playerid] == 1) adds[playerid] = 0; // not sure about this, edit to your own things if i did it wrong } }
Код:
if(strcmp(cmd, "/oglas", true) == 0 || strcmp(cmd, "/oglas", true) == 0) { if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_YELLOW, "Neste logirani !"); return 1; } if(PlayerInfo[playerid][pLevel] < 3) { SendClientMessage(playerid, COLOR_YELLOW, "Mora da ste level 3 za da pisuvate oglas !"); return 1; } if(!PlayerToPoint(10.0,playerid,-2239.4780,130.4675,1035.4141)) { SendClientMessage(playerid, COLOR_YELLOW, "Neste vo Oglasnik !"); return 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_RED, "Koristi: /oglas [ text]"); return 1; } if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))[/COLOR]) { format(string, sizeof(string), "{FF0000}GRESKA:{FFFFFF}Ve molime pocekajte 10 sekundi za da napisete oglas.", (addtimer/10000)); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } new payout = idx * 200; if(GetPlayerMoney(playerid) < payout) { format(string, sizeof(string), "Iskoristivte %d Bukvi koj cinat $%d, Nemate dovolno.", offset, payout); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } GivePlayerMoney(playerid, - payout); SBizzInfo[7][sbTill] += payout; ExtortionSBiz(7, payout); format(string, sizeof(string), "{37F906}[OGLAS]: %s,{F3FF02}Kontakt: %s Mobilen: %d", result, sendername, PlayerInfo[playerid][pPnumber]); OOCNews(TEAM_GROVE_COLOR,string); format(string, sizeof(string), "~r~Plativte $%d~n~~w~Poraka se sostoi od: %d Bukvi", payout, idx); GameTextForPlayer(playerid, string, 5000, 1); if (PlayerInfo[playerid][pAdmin] < 1); SetTimerEx("AddsReset", 30000, false, "i", playerid); } return 1; } forward AddsReset(playerid) public AddsReset(playerid) { if(IsPlayerConnected(playerid)) { if(adds[playerid] == 1) adds[playerid] = 0; // not sure about this, edit to your own things if i did it wrong } } I hope this'll do the trick, I don't quite get your language. |