23.01.2015, 08:59
Can somone help me how to make 30 sec timer .. Somone use the command and others need to wait 30 sec before using the cmd ..
pawn Код:
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;
}