Problem with /sms and with proxdetector
#1

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
Reply
#2

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

....
Reply
#4

Quote:
Originally Posted by [TPG
Coole210 ]

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

....
Reply
#6

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;
}
Reply
#7

....
Reply
#8

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
Reply
#9

....
Reply
#10

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


Forum Jump:


Users browsing this thread: 4 Guest(s)