SA-MP Forums Archive
Problem with /sms and with proxdetector - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with /sms and with proxdetector (/showthread.php?tid=94436)



Problem with /sms and with proxdetector - mirkoiz - 29.08.2009

Hello Sa-Mp Users / Scripters,

FirstProblem:

normally, if you type '/sms 211 job' the 'Jobmanager' should say
"Okay, you want a job" and so on..

then if you type '/sms 211 mechanic' he should say
"Okay, you want to become a Mechanic."

But everytime when i send something to the 211, he asks me 'what do you want from me?'

pawn Код:
if(strcmp(cmd, "/sms", true) == 0)
    {
      if(IsPlayerConnected(playerid))
        {
          if(gPlayerLogged[playerid] == 0)
        {
          SendClientMessage(playerid, GREY, "[ ! ] You are not logged in!");
          return 1;
        }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, GREY, "Useage: /sms [Number] [Text]");
                return 1;
            }
            new phonenumb = strval(tmp);
            new length = strlen(cmdtext);
            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, GREY, "Useage: /sms [Number] [Text]");
                return 1;
            }
            if(phonenumb == 211)
            {
                if ((strcmp("job", result, true, strlen(result)) == 0) && (strlen(result) == strlen("job")))
                {
                    SendClientMessage(playerid, YELLOW, "[ ! ]SMS sent.");
                    SendClientMessage(playerid, PINK, "Job Manager: Okay, you want a Job.");
                    SendClientMessage(playerid, PINK, "Job Manager: Follow the Red marker on your GPS.");
                    jobcp1[playerid] = 1;
                    SetPlayerCheckpoint(playerid, 2352.0186,-1168.5807,27.9719, 10);
                    return 1;
                }
                if ((strcmp("cop", result, true, strlen(result)) == 0) && (strlen(result) == strlen("cop")))
                {
                    SendClientMessage(playerid, YELLOW, "[ ! ]SMS sent.");
                    SendClientMessage(playerid, PINK, "Job Manager: Okay, you want to become a Cop.");
                    SendClientMessage(playerid, PINK, "Job Manager: Go out and follow the Red marker on your GPS.");
                    jobcpcop[playerid] = 1;
                    SetPlayerCheckpoint(playerid, 2352.0186,-1168.5807,27.9719, 10);
                    return 1;
                }
                if ((strcmp("medic", result, true, strlen(result)) == 0) && (strlen(result) == strlen("medic")))
                {
                    SendClientMessage(playerid, YELLOW, "[ ! ]SMS sent.");
                    SendClientMessage(playerid, PINK, "Job Manager: Okay, you want to become a Medic.");
                    SendClientMessage(playerid, PINK, "Job Manager: Go out and follow the Red marker on your GPS.");
                    jobcpmedic[playerid] = 1;
                    SetPlayerCheckpoint(playerid, 2352.0186,-1168.5807,27.9719, 10);
                    return 1;
                }
                if ((strcmp("taxi", result, true, strlen(result)) == 0) && (strlen(result) == strlen("taxi")))
                {
                    SendClientMessage(playerid, YELLOW, "[ ! ]SMS sent.");
                    SendClientMessage(playerid, PINK, "Job Manager: Okay, you want to become a Public Service Driver.");
                    SendClientMessage(playerid, PINK, "Job Manager: Go out and follow the Red marker on your GPS.");
                    jobcptaxi[playerid] = 1;
                    SetPlayerCheckpoint(playerid, 2352.0186,-1168.5807,27.9719, 10);
                    return 1;
                }
                if ((strcmp("prostitute", result, true, strlen(result)) == 0) && (strlen(result) == strlen("prostitute")))
                {
                    SendClientMessage(playerid, YELLOW, "[ ! ]SMS sent.");
                    SendClientMessage(playerid, PINK, "Job Manager: Okay, you want to become a Prostitute.");
                    SendClientMessage(playerid, PINK, "Job Manager: Go out and follow the Red marker on your GPS.");
                    jobcpprostitute[playerid] = 1;
                    SetPlayerCheckpoint(playerid, 2352.0186,-1168.5807,27.9719, 10);
                    return 1;
                }
                if ((strcmp("mineworker", result, true, strlen(result)) == 0) && (strlen(result) == strlen("mineworker")))
                {
                    SendClientMessage(playerid, YELLOW, "[ ! ]SMS sent.");
                    SendClientMessage(playerid, PINK, "Job Manager: Okay, you want to become a Mine Worker.");
                    SendClientMessage(playerid, PINK, "Job Manager: Go out and follow the Red marker on your GPS.");
                    jobcpmineworker[playerid] = 1;
                    SetPlayerCheckpoint(playerid, 2352.0186,-1168.5807,27.9719, 10);
                    return 1;
                }
                if ((strcmp("mechanic", result, true, strlen(result)) == 0) && (strlen(result) == strlen("mechanic")))
                {
                    SendClientMessage(playerid, YELLOW, "[ ! ]SMS sent.");
                    SendClientMessage(playerid, PINK, "Job Manager: Okay, you want to become a Mechanic.");
                    SendClientMessage(playerid, PINK, "Job Manager: Go out and follow the Red marker on your GPS.");
                    jobcpmechanic[playerid] = 1;
                    SetPlayerCheckpoint(playerid, 2352.0186,-1168.5807,27.9719, 10);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, PINK, "Job Manager: What do you want from me?");
                    return 1;
                }
            }
        }
        return 1;
    }
How can i solve this?


_________________________________________________

Secound Problem:

when i send any Message, it should be sent with the Color of the player, but currently it only send the message in Black...

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[256];
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(realchat)
    {
        format(string, sizeof(string), "%s: %s", sendername, text);
        new playercolor = GetPlayerColor(playerid);
        ProxDetector(25.0, playerid, string,playercolor,playercolor,playercolor,playercolor,playercolor);
        messages[playerid] += 1;
        return 0;
    }
    return 1;
}
How to solve this

_________________________________________________

Greetings: Cookie



Re: Problem with /sms and with proxdetector - aleksandra - 29.08.2009

I want to know that too just wanted to make new post... and saw this


Re: Problem with /sms and with proxdetector - coole210 - 29.08.2009

....


Re: Problem with /sms and with proxdetector - mirkoiz - 29.08.2009

Quote:
Originally Posted by [TPG
Coole210 ]

pawn Код:
if(RandVar[playerid] == 0)
{
strings, prox detector
return 0;
}
isnt it the same like mine?


Re: Problem with /sms and with proxdetector - coole210 - 29.08.2009

....


Re: Problem with /sms and with proxdetector - mirkoiz - 29.08.2009

Quote:
Originally Posted by [TPG
Coole210 ]
get rid of messages and your old variable and yes (messages[playerid] += 1; i mean )
the
pawn Код:
messages += 1;
is for another thing.. this is the whole code.....
pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[256];
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(gPlayerLogged[playerid] == 0)
    {
      SendClientMessage(playerid, GREY, "[ ! ] You are not logged in!");
      return 0;
    }
    if(messages[playerid] >= 5)
    {
        format(string, 128, "[ ! ] %s has been kicked by AC for : FLOOD REQUEST !", sendername);
        SendClientMessageToAll(0xFF6347AA, string);
        Kick(playerid);
    }
    if(realchat)
    {
        format(string, sizeof(string), "%s: %s", sendername, text);
        new playercolor = GetPlayerColor(playerid);
        ProxDetector(25.0, playerid, string,playercolor,playercolor,playercolor,playercolor,playercolor);
        messages[playerid] += 1;
        return 0;
    }
    return 1;
}



Re: Problem with /sms and with proxdetector - coole210 - 29.08.2009

....


Re: Problem with /sms and with proxdetector - mirkoiz - 29.08.2009

nope.. i do not directly try to make a copy...

i just try to make a AC

B.t.W this post is about the problem with the Message Colors


Re: Problem with /sms and with proxdetector - coole210 - 29.08.2009

....


Re: Problem with /sms and with proxdetector - mirkoiz - 29.08.2009

Both not working (/sms) and the clientmessage thing...