29.08.2009, 21:52
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?'
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...
How to solve this
_________________________________________________
Greetings: Cookie
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;
}

_________________________________________________
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;
}

_________________________________________________
Greetings: Cookie