sscanf2 CELLMIN_ON_MATCHES -
AroseKhanNiazi - 06.09.2014
pawn Код:
new TargetID,seconds,mins,reason[50];
sscanf(params,"?<CELLMIN_ON_MATCHES=1>U(-1)",TargetID); // error line
if(TargetID == -1) return SendClientMessage(playerid,COLOR_ERROR,"Please Enter An Value");
if (TargetID == cellmin)
{
foreach(Player,i)if(!strcmp(PlayerInfo[TargetID][pUserName],PlayerInfo[i][pUserName])) TargetID=i;
else return SendClientMessage(playerid,COLOR_ERROR,ERROR_MULTIPLE_MATCHES);
}
else if (TargetID == INVALID_PLAYER_ID)
{
SendClientMessage(playerid,COLOR_ERROR,ERROR_INVALID_PLAYER);
}
else
{
new string[50];
format(string,sizeof(string),"%d is the id of player.",TargetID);
SendClientMessage(playerid,-1,string);
}
ok this is the code but now how i use more sscanf specifiers for different work ?
i tried it as
pawn Код:
if(!sscanf(params,"?<CELLMIN_ON_MATCHES=1>u",TargetID))// error line
or
pawn Код:
if(sscanf(params,"?<CELLMIN_ON_MATCHES=1>u",TargetID))// error line
i got this error
Код:
error 035: argument type mismatch (argument 1)
i can't figure out way of using sscanf with cellmin_on_matches=1 and using other specifers with it too like i need to use 1 for time and string... and can we set cellmin_on_matches=1 by using sscanf_options
Re: sscanf2 CELLMIN_ON_MATCHES -
AroseKhanNiazi - 07.09.2014
Quote:
Originally Posted by ******
You don't show how you declared "params".
|
i am using it as an command for testing how the system works
edit: sorry i missed to add [] in params it took me like 10 hours to figure it out :/

ok i want to ask how to set CELLMIN_ON_MATCHES globally
edit 2:
so i worked on script set the cellmin globally
pawn Код:
if (TargetID == cellmin)
{
foreach(Player,i) if(!strcmp(PlayerInfo[TargetID][pUserName],PlayerInfo[i][pUserName])){ TargetID=i; print("case 1");}
else { print("case 2"); SendClientMessage(playerid,COLOR_ERROR,ERROR_MULTIPLE_MATCHES); }
}
so this won't work command won't get executed and nothing in print
full command i will work on it its just testing now
pawn Код:
CMD:i(playerid,params[])
{
new TargetID;
if(!sscanf(params, "u", TargetID))
{
//if(TargetID == -1) return SendClientMessage(playerid,COLOR_ERROR,"Please Enter An Value");
if (TargetID == cellmin)
{
foreach(Player,i) if(!strcmp(PlayerInfo[TargetID][pUserName],PlayerInfo[i][pUserName])){ TargetID=i; print("case 1");}
else { print("case 2"); SendClientMessage(playerid,COLOR_ERROR,ERROR_MULTIPLE_MATCHES); }
}
else if (TargetID == INVALID_PLAYER_ID)
{
SendClientMessage(playerid,COLOR_ERROR,ERROR_INVALID_PLAYER);
}
else
{
new string[50];
format(string,sizeof(string),"%d is the id of player.",TargetID);
SendClientMessage(playerid,-1,string);
}
}else print("empty");
return 1;
}
Re: sscanf2 CELLMIN_ON_MATCHES -
AroseKhanNiazi - 07.09.2014
I DID read it i got the CELLMIN_ON_MATCHES but one thing
pawn Код:
if (TargetID == cellmin)
{
foreach(Player,i) if(!strcmp(PlayerInfo[TargetID][pUserName],PlayerInfo[i][pUserName])){ TargetID=i; print("case 1");}
else { print("case 2"); SendClientMessage(playerid,COLOR_ERROR,ERROR_MULTIPLE_MATCHES); }
}
when its this case the command does not get executed and nothing happens not even these print none of them
Re: sscanf2 CELLMIN_ON_MATCHES -
AroseKhanNiazi - 07.09.2014
ralf i figured that part already the problem if if there are two players online one named sasuke and one named sasuke. we can get sasuke. by typing it but there is noway for getting sasuke so i tried to make the code that the thing i enter it finds all players online and compare the text i enter there with all players online and if there is result founded it returns that id, other than that i got it if i type sas it should / will return the multiple matches error message
example
Players Online
i did /i sas
it returns me please be more specific ... that's fine
but when i do /i sasuke
it should return me the id or whatever of the player online by name "sasuke"
Re: sscanf2 CELLMIN_ON_MATCHES -
AroseKhanNiazi - 07.09.2014
edit ralf i tired it many times if you say i will show you