[HELP]CP come before cmd -
fuckingcruse - 10.04.2015
So , see this , i tried to make a cmd , I.e /sms , it will ask for a number that is 477 , if it is yes then he gets cp , if no then a msg will come " sorry ......" , and if he wants it again , so i made redo too..
But when player type /sms he automatic gets the cp , it dont wait for yes or no see this
Код:
CMD:sms(playerid,params[])
{
new option[20];
if(isnull(params))
{
SendClientMessage(playerid, -1, "USAGE: /sms <number> <message>");
}
if(!strcmp(option, "477 yes", true))
{
SendClientMessage(playerid,-1 , " Great! We have a Job for you , come to the Job house. ");
SetPlayerCheckpoint(playerid , 2351.8401,-1170.1030,28.0473 , 2.0);
return 1;
}
if(!strcmp(option, "477 no", true))
{
SendClientMessage(playerid, -1 , " Sorry! If you need the job anytime , type /sms redo");
return 1;
}
if(!strcmp(option , "redo",true))
{
SendClientMessage(playerid, -1, "USAGE: /sms <number> <message>");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid,2,2345.8508,-1184.4211,1027.9766))
{
ShowPlayerDialog(playerid, DIALOG_JOB, DIALOG_STYLE_LIST, "Job", "Public Driver Service", "Close", "");
return 1;
}
return 1;
}
What i want is when player type following cmd those thing must happen
/sms 477 yes >> he must get that msg and CP
/sms 477 no >> he must get that msg , and nothing
/sms redo >> He will get that msg ..
Help please
Re: [HELP]CP come before cmd -
De4dpOol - 10.04.2015
pawn Код:
#include <sscanf2> //At the top of the script.
CMD:sms(playerid, params[])
{
new Number, Message[10];
if(sscanf(params, "is[10]", Number, Message))
if(isnull(params)) SendClientMessage(playerid, -1, "USAGE: /sms <number> <message>");
if(!strcmp(Message, "yes", true, 3))
{
SendClientMessage(playerid,-1 , " Great! We have a Job for you , come to the Job house. ");
SetPlayerCheckpoint(playerid , 2351.8401,-1170.1030,28.0473 , 2.0);
return 1;
}
if(!strcmp(Message, "no", true, 2))
{
SendClientMessage(playerid, -1 , " Sorry! If you need the job anytime , type /sms redo");
return 1;
}
if(!strcmp(Message, "redo", true, 4))
{
SendClientMessage(playerid, -1, "USAGE: /sms <number> <message>");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid,2,2345.8508,-1184.4211,1027.9766))
{
ShowPlayerDialog(playerid, DIALOG_JOB, DIALOG_STYLE_LIST, "Job", "Public Driver Service", "Close", "");
return 1;
}
return 1;
}
Used sscanf for this. Still untested.
Re: [HELP]CP come before cmd -
fuckingcruse - 10.04.2015
Dude and where is the number 477?
Re: [HELP]CP come before cmd -
fuckingcruse - 10.04.2015
still not working
Re: [HELP]CP come before cmd -
De4dpOol - 10.04.2015
Quote:
Originally Posted by fuckingcruse
Dude and where is the number 477?
|
Sorry just forgot that.
pawn Код:
CMD:sms(playerid, params[])
{
new Number, Message[10];
if(sscanf(params, "is[10]", Number, Message)) return SendClientMessage(playerid, -1, "USAGE: /sms <number> <message>");
if(Number == 477)
{
if(!strcmp(Message, "yes", true, 3))
{
SendClientMessage(playerid,-1 , " Great! We have a Job for you , come to the Job house. ");
SetPlayerCheckpoint(playerid , 2351.8401,-1170.1030,28.0473 , 2.0);
return 1;
}
if(!strcmp(Message, "no", true, 2))
{
SendClientMessage(playerid, -1 , " Sorry! If you need the job anytime , type /sms redo");
return 1;
}
if(!strcmp(Message, "redo", true, 4))
{
SendClientMessage(playerid, -1, "USAGE: /sms <number> <message>");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid,2,2345.8508,-1184.4211,1027.9766))
{
ShowPlayerDialog(playerid, DIALOG_JOB, DIALOG_STYLE_LIST, "Job", "Public Driver Service", "Close", "");
return 1;
}
}
return 1;
}
Re: [HELP]CP come before cmd -
fuckingcruse - 10.04.2015
Now when i type /sms 477 yes , it always shows , /sms <number> <message> ... and dont do anything