Jump to content
  • 0

Problema sms


iulian24

Question

Se intampla ca atunci cand intru in joc, sa mearga sa trimit / primesc sms-uri de la playeri, totul e ok.

Dar cateodata se intampla sa scriu un sms si sa nu imi apara nimic, nici-o eroare, pur si simplu nimic, Ceva idei de rezolvare va rog?

 

CMD:sms(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
    {
        new phonenumb,smstext[90],sendername[30],giveplayer[30],string[256],giveplayerid,string2[184];
        if(PlayerInfo[playerid][pMuted] == 1)
        {
            format(string, sizeof(string), "You can not speak, you have been silenced for %d seconds.",PlayerInfo[playerid][pMuteTime]);
            SendClientMessage(playerid, COLOR_LIGHTRED, string);
            return 1;
        }
        if(sscanf(params, "is[90]",phonenumb,smstext)) return SendClientMessage(playerid, 0xFFFFFFFF,"{FF9900}Scrie: {33CCFF}/sms <Number> <Text>");
        if(FindIP(smstext)) /// Anti-Reclama
        {
            new advertiser[MAX_PLAYER_NAME];
            GetPlayerName(playerid, advertiser, sizeof(advertiser));
            format(string, sizeof(string), "{f03337}Warning: %s(%d) typed %s in /sms.", advertiser, playerid, smstext);
            ABroadCast(COLOR_WHITE,string,1);
        }
        for(new i; i < sizeof(TLD); i++)
        {
            if(strfind(smstext, TLD, true) != -1)
            {
                if(strfind(smstext, "rpg-green-zone.forumgratuit.ro", true) != -1 || strfind(smstext, "rpg-green-zone.forumgratuit.ro", true) != -1 || strfind(smstext, "rpg-green-zone.forumgratuit.ro", true) != -1) break;
                new advertiser[MAX_PLAYER_NAME];
                GetPlayerName(playerid, advertiser, sizeof(advertiser));
                format(string, sizeof(string), "{f03337}Warning: %s(%d) typed %s in /sms.", advertiser, playerid, smstext);
                ABroadCast(COLOR_WHITE,string,1);
            }
        }
        if(PlayerInfo[playerid][pPnumber] == 0) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You dont't have a cell phone.");
        if(PhoneOnline[playerid] > 0) return SCM(playerid, COLOR_WHITE, "{FFB870}Your phone turned off.");
        if(PlayerInfo[playerid][pCredits] < 2) return SCM(playerid,COLOR_WHITE,"{FFB870}You don't have credits needed.");
        foreach(Player,i)
        {
            if(PlayerInfo[pPnumber] == phonenumb && phonenumb != 0)
            {
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        giveplayerid = i;
                        if(PhoneOnline[giveplayerid] > 0) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}That players phone is offline.");
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "SMS from %s (%d): %s",sendername,PlayerInfo[playerid][pPnumber],smstext);
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        format(string2, sizeof(string2), "{63969C}SMS sent to %s (%d): %s",giveplayer,PlayerInfo[giveplayerid][pPnumber],smstext);
                        SendClientMessage(giveplayerid,COLOR_YELLOW, string);
                        SendClientMessage(playerid,COLOR_WHITE, string2);
                        new var100[300],resulttt[300],strr[300];
                        format(strr, sizeof(strr),"(sms) %s",smstext);
                        mysql_real_escape_string(strr, resulttt);
                        mysql_format(SQL,var100, sizeof(var100), "INSERT INTO chat_logs (`playerid`,`text`) VALUES ('%d','%s')", PlayerInfo[playerid][pSQLID],resulttt);
                        mysql_tquery(SQL,var100,"","");
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                        PlayerPlaySound(giveplayerid, 1139, 0.0, 0.0, 0.0);
                        PlayerInfo[playerid][pCredits] = PlayerInfo[playerid][pCredits] - 2;
                        LastPlayer = playerid;
                        for(new adm = 0; adm<=MAX_PLAYERS;adm++)
                         {
                             if(IsPlayerConnected(adm))
                            {
                                  if(PlayerInfo[adm][pAdmin] > 0 && BigEar[adm] == 1)
                                {
                                    format(string, sizeof(string), "{63969C}SMS from %s (%d) to %s (%d): %s",sendername,playerid,giveplayer,giveplayerid,smstext);
                                    SendClientMessage(adm,  COLOR_WHITE, string);
                                }
                            }
                          }
                    }
                }
            }
        }
    }
    return 1;
}

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

poate ti-sa terminat creditul si de asta nu mai poti sa dai sms

   uite la fiecare sms iti ea 2$ la credit if(PlayerInfo[playerid][pCredits] < 2) return SCM(playerid,COLOR_WHITE,"{FFB870}You don't have credits needed.");

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
Acum 2 minute, Geani a spus:

poate ti-sa terminat creditul si de asta nu mai poti sa dai sms

   uite la fiecare sms iti ea 2$ la credit if(PlayerInfo[playerid][pCredits] < 2) return SCM(playerid,COLOR_WHITE,"{FFB870}You don't have credits needed.");

PlayerInfo[playerid][pCredits] = PlayerInfo[playerid][pCredits] - 2;

 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0

Problema inca persista , adica merge cateodata, cateodata nu mai merge sa dau /sms si nici nu apare nimic, si chiar si atunci cand merge si dau /sms la un numar random care nu exista , la fel , nu imi apare nimic , nu zice " That players phone is offline"

 

Ceva pareri de rezolvare?

Link to comment
Share on other sites

  • 0

Problema e aici (presupun)

if(IsPlayerConnected(giveplayerid))
{
	if(giveplayerid != INVALID_PLAYER_ID)
	{
	}
}

Pentru ca tu verifici daca jucatorul (giveplayerid) este conectat, la initalizare este 0, inainte de a face o atribuire si cand jucatorul cu ID-ul 0 nu este conectat, apare problema.

Link to comment
Share on other sites

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.