PDA

View Full Version : Stop sending


StR_MaRy
26/09/2016, 06:54 PM
hey guys i have a quest and when i enter on a pickup how can i stop sending every sec a message if you stay in that pickup ? and give only 1 ?

for(new q=0; q<50; q++)
{
if(pickupid == QuestP[q])
{
if(QEvent[playerid][q] == 0)
{
new str[2000],queryy[2000];
if(QuestWait[playerid] > 0)
{
format(str, sizeof(str),"Asteapta %d secunde inainte de a colecta un alt dolar.", QuestWait[playerid]);
SendClientMessage(playerid, COLOR_WHITE, str);
return 1;
}
QEvent[playerid][q] = 1;
QuestWait[playerid] = 120;
mysql_format(SQL,queryy,sizeof(queryy),"UPDATE `users` SET `Quest%d`='1' WHERE `name`='%s'",q,PlayerInfo[playerid][pNormalName]);
mysql_tquery(SQL,queryy,"","");
new remain = 50;
for(new qs=0; qs<50; qs++)
{
if(QEvent[playerid][qs] == 1)
{
remain--;
}
}
if(remain > 0)
{
format(str, sizeof(str),"Felicitari! Ai gasit un dolar. Gaseste inca %d dolari pentru a primi un premiu special.", remain);
SendClientMessage(playerid, COLOR_GREEN, str);
}
else if(remain == 0)
{
new randomcash = 1500000 + random(1000000) + random(1500000), randomrp = 5 + random(10), name[30], randompremium = random(10), randompoints = 10 + random(30);
GetPlayerName(playerid, name, sizeof(name));
if(randompremium != 7)
{
format(str, sizeof(str),"Felicitari! Ai gasit cei 50 de dolari si ai primit $%s si %d puncte respect.", FormatNumber(randomcash), randomrp);
SendClientMessage(playerid, COLOR_GREEN, str);
format(str, sizeof(str),"AdmBot: %s a gasit cei 50 de dolari si a primit $%s si %d puncte respect.", name, FormatNumber(randomcash), randomrp);
SendClientMessageToAll(COLOR_WHITE, str);
}
else
{
format(str, sizeof(str),"Felicitari! Ai gasit cei 50 de dolari si ai primit $%s, %d puncte respect si %d puncte premium.", FormatNumber(randomcash), randomrp, randompoints);
SendClientMessage(playerid, COLOR_GREEN, str);
format(str, sizeof(str),"AdmBot: %s a gasit cei 50 de dolari si a primit $%s, %d puncte respect si %d puncte premium.", name, FormatNumber(randomcash), randomrp, randompoints);
SendClientMessageToAll(COLOR_WHITE, str);
PlayerInfo[playerid][pPremiumPoints] += randompoints;
Update(playerid, pPremiumPointsx);
}
GivePlayerCash(playerid, randomcash);
PlayerInfo[playerid][pExp] += randomrp;
Update(playerid, pCashx);
Update(playerid, pRP);
}
}
else return SendClientMessage(playerid, COLOR_WHITE, "Ai gasit aceast dolar, continua sa cauti alti dolari.");
}
}