[Pomoc] /sms

Započeo ZC_Bob, Septembar 11, 2013, 14:20:41 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: S.E
Detaljan opis problema: Kako da napravim da kada igrac posalje sms da se to sacuva i u server.log , znam da treba koristi print funkciju, ali kako? Znaci npr kada igrac posalje nekome sms da mi u server.log izadje ovako nesto:
Marko_Markovic je poslao sms Peri_Pericu, tekst sms-a glasi: Ovde tekst koji je poslat
Dio skripte: Evo komanda /sms pa ako mi mozete pomoci
if(strcmp(cmd, "/txt", true) == 0 || strcmp(cmd, "/t", true) == 0 || strcmp(cmd, "/sms", true) == 0)
{
    if(IsPlayerConnected(playerid))
{
    new playercash;
    playercash = GetPlayerMoney(playerid);
    if (playercash < 2)
    {
            SendClientMessage(playerid, COLOR_GREY, "[GRESKA] Nemate dovoljno novca na racunu!");
            return 1;
    }
    if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "[GRESKA] Niste se prijavili!");
            return 1;
        }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /sms [broj] [text]");
return 1;
}
            if(PlayerInfo[playerid][pJailed] == 1)
    {
    SCM(playerid,COLOR_GRAD1,"{F81414}[GRESKA] {C0C0C0}Nemozete koristiti tu komandu kad ste u zatvoru!");
    return 1;
    }
if(PlayerInfo[playerid][pPnumber] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "[GRESKA] Nemate telefon !");
return 1;
}
            if(PlayerInfo[playerid][pKredit1] < 2)
{
SendClientMessage(playerid, COLOR_GRAD2, "[GRESKA] Nemate vise kredita !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s je uzeo telefon iz dzepa.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new phonenumb = strval(tmp);
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, "Koriscenje: /sms [broj] [text]");
return 1;
}
if(phonenumb == 555)
{
if ((strcmp("yes", result, true, strlen(result)) == 0) && (strlen(result) == strlen("yes")))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[INFO] {ffffff}SMS Poruka je poslata.");
if (gTeam[playerid] == 2 || gTeam[playerid] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[SMS]: {ffffff}Nemam pojma o cemu pricas, Salje: MOLE (555).");
RingTone[playerid] = 20;
return 1;
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[SMS]: {ffffff}Obicno Yes je dovoljno, Salje: MOLE (555).");
RingTone[playerid] = 20;
return 1;
}
}
foreach (Player, i)
{
if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
{
giveplayerid = i;
Mobile[playerid] = giveplayerid; //caller connecting
if(IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
        if(PhoneOnline[giveplayerid] > 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "[GRESKA] Igrac je offline!");
            return 1;
        }
                                new brojevi[] = { '1','2','3','4','5','6','7','8','9'};
                        for(new b = 0; b < sizeof brojevi; b++)
                    {
                new teks1t = strlen(result);
                    for(new a = 0; a<teks1t; a++)
            {
            if(result[a] == brojevi[b])
            result[a] = '*' ;
            }
                    }
format(string, sizeof(string), "{00C0FF}[SMS]: {FFFFFF}%s | Salje: %s | Br.Tel (%d) |.", result,sendername,PlayerInfo[playerid][pPnumber]);
GetPlayerName(giveplayerid, sendername, sizeof(sendername));
RingTone[giveplayerid] =20;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[INFO] {ffffff}Poslali ste sledecu poruku igracu:");
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
SendClientMessage(playerid,  COLOR_YELLOW, string);
                                PlayerInfo[playerid][pKredit1] -= 4;
SBizzInfo[2][sbTill] += 2;
ExtortionSBiz(2, 2);
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            Mobile[playerid] = 255;
return 1;
}
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, "[GRESKA] Poruka nije poslata !");
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): //

eo ti primjer
   new File:lFile = fopen("SmSlog.txt", io_append),
logData[256],
fyear, fmonth, fday,
fhour, fminute, fsecond;
getdate(fyear, fmonth, fday);
gettime(fhour, fminute, fsecond);
format(logData, sizeof(logData),"[%02d/%02d/%04d %02d:%02d:%02d] Igrac %s koristio /sms: %s !  ", fday, fmonth,fyear,fhour,fminute, fsecond, PlayerName(playerid) ,poruka);
fwrite(lFile, logData);
fclose(lFile);
Poslednja Izmena: Septembar 11, 2013, 15:01:50 POSLE PODNE od KuNNaâ„¢

Zar ne moze samo da se ubaci negde print funkcija i da se tako zapisuje sve to u server log? :'(