Params
#1

PHP код:
if(strcmp(cmd"/tban"true) == 0)
    {
    new 
banner[MAX_PLAYER_NAME], banned[MAX_PLAYER_NAME], bannedidreason[25], hoursstring[400], secsunbantsip[16], query[180];
    if(!
IsPlayerAdmin(playerid) && PInfo[playerid][AdminLevel] < 0) return SendClientMessage(playeridCOLOR_ERROR"You do not have sufficient permissions to use this command."); //this is just my admin check, yours may be different.
    
if(sscanf(params"uds[25]"bannedidhoursreason)) return SendClientMessage(playerid, -1"Usage: /tempban [player name/ID] [hours] [reason]"); // here, we're checking if the administrator entered the command correctly. "u" is a player name or ID, "d" is the amount of hours as an integer, and "s[25]" is the reason.
    
if(!IsPlayerConnected(bannedid)) return SendClientMessage(playerid, -1"Invalid player name/ID."); //checking if the player that the admin is trying to ban is connected to the server
    
if(PInfo[playerid][AdminLevel] < PInfo[bannedid][AdminLevel]) return SendClientMessage(playerid, -1"You cannot ban someone with a higher level than you!"); //I don't allow admins to ban those with higher levels than their own.
    
if(strlen(reason) < || strlen(reason) > 24) return SendClientMessage(playerid, -1"Your reason must be between 3 and 24 characters."); //limiting the reason length to 3-24 characters
    
if(hours 12 || hours 720) return SendClientMessage(playerid, -1"Ban hours are between 12 and 720 hours"); //making sure the ban duration is no shorter than 12 hours and no longer than 30 days
    
GetPlayerName(playeridbannersizeof(banner));
    
GetPlayerName(bannedidbannedsizeof(banned));
    
GetPlayerIp(bannedidipsizeof(ip));
    
secs hours*3600;
    
unbants gettime()+ secs;
    
format(querysizeof(query), "INSERT INTO `tbans` (ban_id, player, ip, admin, reason, ban_time, unban_time) VALUES ('0', '%s', '%s', '%s', '%s', %d, %d)",
    
bannedipbannerreasongettime(), unbants);
    
mysql_query(query);
    
format(stringsizeof(string), "You've been temporarily banned.\n\n{FFFFFF}Admin Banned: %s\nReason: %s"bannerreason);
    
ShowPlayerDialog(bannedid678DIALOG_STYLE_MSGBOX"Banned!"string"Close""");
    
format(stringsizeof(string), "%s(%d) has banned %s(%d) for %d hours for: %s"bannerplayeridbannedbannedidhoursreason);
    
SendClientMessageToAll(-1string);
    
SetTimerEx("KickEx"500false"i"playerid);
    return 
1;
    } 
getting error undefined symbol params
Reply
#2

Yeah well, you can't expect a command originally written in a command processor to suddenly work without one. Frankly I don't understand why you go through all the trouble to convert a new system to an old system rather than the other way around. That seems very counterproductive. Bite the bullet and convert all existing commands to ZCMD.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)