Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
Strings parameters always have to be last otherwise it will split by the first space it will find (single words).
The specifier for integer is i
Posts: 1,219
Threads: 51
Joined: Jul 2012
"uis[25]"
You forgot the specifier for your integer variable "hours"
Posts: 599
Threads: 48
Joined: May 2016
PHP код:
CMD:tempban(playerid, params[])
{
new bannedid, reason[25], hours;
if(sscanf(params, "uis[25]", bannedid, reason,hours)) return SendClientMessage(playerid, RED, "/tempban [player] [reason] [time]");
return 1;
}
Posts: 157
Threads: 57
Joined: Jul 2015
Reputation:
0
I dont know why but it still doesnt work
CMD:tempbanban(playerid, params[])
{
new bannedid, reason[25], hours;
if(sscanf(params, "uis[25]", bannedid, hours, reason)) return SendClientMessage(playerid, RED, "/tempban [player] [reason] [time]");
return 1;
}
Posts: 599
Threads: 48
Joined: May 2016
PHP код:
CMD:tempban(playerid, params[])
{
new bannedid, reason[25], hours;
if(sscanf(params, "uis[25]", bannedid, hours, reason)) return SendClientMessage(playerid, RED, "/tempban [player] [time] [reason]");
return 1;
}
reason it's last params
@Sunehildeep didn't notice it :P also it's "usi[25]"
Posts: 599
Threads: 48
Joined: May 2016
Quote:
Originally Posted by ax1
It still doesnt work. When I type for example /tempban name 4 cheating i still get /tempban [player] [time] [reason] message
|
show us rest of code ?