24.07.2014, 11:46
(
Последний раз редактировалось AroseKhanNiazi; 24.07.2014 в 13:45.
)
well ok idk but how is this gonna work first how can i make it globally to 1, after that how can we make if the player types uchiha and the name is sasuke_uchiha it will work with making MATCH_NAME_PARTIAL but how to do that if there are 3 online player 1 me and other two Sasuke_uchiha and Itachi_Uchiha if i type uchiha it should say "Uchiha is found in multiple name please be more specific" and i am using specifiers "U".
And Can You make the example with this command
and how can i make multiple sscanf like if we don't enter the the time and just the reason skip it if we want or we can type the time if we want some thing like
how can i make that if i use this way it works and if i use this way /jail [playerid] [hour] [minute] [reason] it should work but if u i use /jail [playerid] [reason] this way should work to and here hour and minute are 1:30 (their default values)
And Can You make the example with this command
pawn Код:
CMD:jail(playerid,params[])
{
new TargetID,mins,hours,reason[100], string[256];
if(pInfo[playerid][Adminlevel] < 5) return SCM(playerid, COLOR_ERROR,""ERROR_MESSAGE"");
if(!pInfo[playerid][LoggedInAsAdmin]) return SCM(playerid,COLOR_ERROR,""ERROR_MESSAGE"");
if(caged[TargetID] == 1) return SCM(playerid,COLOR_ERROR,CAGED_ERROR);
if(sscanf(params, "uI(1)I(30)S()[50]", TargetID,hours,mins,reason)) return SCM(playerid, COLOR_ERROR, "Usage: /jail (Name/ID) (Hours) (Mins) (Reason)");
if(TargetID == INVALID_PLAYER_ID || !IsPlayerConnected(TargetID )) return SCM(playerid, COLOR_ERROR, ERROR_INVALID_PLAYER);
if(pInfo[TargetID][Adminlevel] && TargetID != playerid) return SCM(playerid,COLOR_ERROR,"You Can't Use this Command On An Admin");
if(pInfo[TargetID][Jailed] == 0)
{
pInfo[TargetID][pJailHour] =hours;
pInfo[TargetID][pJailMinute] =mins;
JailPlayer(TargetID);
SetPlayerInterior(TargetID,10);
pInfo[TargetID][Jailed] = 1;
if(!strlen(reason)) format(string,sizeof(string),">> JAIL: "ORANGE"%s (%d)"ADMIN" (Admin Jail) No Reason Specified",pInfo[TargetID][playername],TargetID);
else format(string,sizeof(string),">> JAIL: "ORANGE"%s (%d)"ADMIN" (Admin Jail) (reason: %s)",pInfo[TargetID][playername],TargetID,reason);
SCMA(COLOR_ADMIN,string);
}
else
{
format(string,sizeof(string),"You have released %s (%d) form jail",pInfo[TargetID][playername],TargetID);
SCM(playerid,COLOR_SKYBLUE,string);
SCM(TargetID,COLOR_SKYBLUE,"You have been released from jail by an admin.");
JailRelease(TargetID);
}
return 1;
}
pawn Код:
if(sscanf(params, "uI(1)I(30)S()[50]", TargetID,hours,mins,reason))