Too much errors -_-
#1

Код:
wcrp\admin.pwn(469) : error 017: undefined symbol "mysql_function_query"
wcrp\admin.pwn(543) : warning 219: local variable "Z" shadows a variable at a preceding level
wcrp\admin.pwn(607) : error 001: expected token: ")", but found "-string-"
wcrp\admin.pwn(607) : warning 215: expression has no effect
wcrp\admin.pwn(607) : warning 215: expression has no effect
wcrp\admin.pwn(607) : error 001: expected token: ";", but found ")"
wcrp\admin.pwn(607) : error 029: invalid expression, assumed zero
wcrp\admin.pwn(607) : fatal error 107: too many error messages on one line
Line 469:
Код:
new ajailtimer;
#pragma unused ajailtimer
adminOnGameModeInit() {
	for(new i=0;i<sizeof(admincmdalts);i++) {
		Command_AddAltNamed( admincmdalts[i][EACmdAltName], admincmdalts[i][EACmdAltAltName]);
	}
	ajailtimer = SetTimer("AJailTimer", 5000, true);
	mysql_function_query(g_mysql_handle, "SELECT `motd`,`amotd` FROM `misc`", true, "OnLoadMOTD", "");
}
Line 469:
Код:
	mysql_function_query(g_mysql_handle, "SELECT `motd`,`amotd` FROM `misc`", true, "OnLoadMOTD", "");
Line 543:
Quote:

YCMD:getpos(playerid, params[], help) {
if(help) {
SendClientMessage(playerid, X11_WHITE, "Gets a players position");
return 1;
}
new Float:X,Float:Y,Float:Z,Float:A;
new interior, vw, playa;
new msg[128];
if(!sscanf(params,"u", playa)) {
if(!IsPlayerConnectEx(playa)) {
SendClientMessage(playerid, X11_TOMATO_2, "User not found");
return 1;
}
GetPlayerPos(playa, X, Y, Z);
GetPlayerFacingAngle(playa, A);
interior = GetPlayerInterior(playa);
vw = GetPlayerVirtualWorld(playa);
format(msg, sizeof(msg), "%s's pos: X: %f Y: %f Z: %f Angle: %f",GetPlayerNameEx(playa, ENameType_CharName), X, Y, Z, A);
SendClientMessage(playerid, X11_WHITE, msg);
format(msg, sizeof(msg), "Interior: %d Virtual World: %d", interior, vw);
SendClientMessage(playerid, X11_WHITE, msg);
if(IsPlayerInAnyVehicle(playa)) {
new carid = GetPlayerVehicleID(playa);
GetVehiclePos(carid, X, Y, Z);
vw = GetVehicleVirtualWorld(carid);
GetVehicleZAngle(carid, A);
format(msg, sizeof(msg), "Vehicle %d's pos: X: %f Y: %f Z: %f Angle: %f",carid, X, Y, Z, A);
SendClientMessage(playerid, X11_WHITE, msg);
format(msg, sizeof(msg), "Virtual World: %d", vw);
SendClientMessage(playerid, X11_WHITE, msg);
}
} else {
SendClientMessage(playerid, X11_WHITE, "USAGE: /getpos [playerid/name]");
}
return 1;
}

Line 543:
Quote:

new Float:X,Float:Y,Float:Z,Float:A;

Line 607:
Код:
YCMD:unban(playerid, params[], help) {
	if(help) {
		SendClientMessage(playerid, X11_WHITE, "Unbans a player");
		return 1;
	}
	new name[(MAX_PLAYER_NAME*2)+1];
	query[0] = 0;//[256];
	if(sscanf(params,"s[" #MAX_PLAYER_NAME "]",name)
		mysql_real_escape_string(name, name);
		format(query, sizeof(query), "DELETE FROM `bans` WHERE `accountid` = (SELECT `id` FROM `accounts` WHERE `username` = \"%s\")",name);
		mysql_function_query(g_mysql_handle, query, true, "BanDeleteCallback", "dds",playerid, 0, name);
	} else {
		SendClientMessage(playerid, X11_WHITE, "USAGE: /unban [accountname]");
	}
	return 1;
}
Line 607:
Код:
	if(sscanf(params,"s[" #MAX_PLAYER_NAME "]",name)
Reply
#2

Missing a brace here:
pawn Код:
YCMD:unban(playerid, params[], help) {
    if(help) {
        SendClientMessage(playerid, X11_WHITE, "Unbans a player");
        return 1;
    }
    new name[(MAX_PLAYER_NAME*2)+1];
    query[0] = 0;//[256];
    if(sscanf(params,"s[" #MAX_PLAYER_NAME "]",name){
        mysql_real_escape_string(name, name);
        format(query, sizeof(query), "DELETE FROM `bans` WHERE `accountid` = (SELECT `id` FROM `accounts` WHERE `username` = \"%s\")",name);
        mysql_function_query(g_mysql_handle, query, true, "BanDeleteCallback", "dds",playerid, 0, name);
    } else {
        SendClientMessage(playerid, X11_WHITE, "USAGE: /unban [accountname]");
    }
    return 1;
}
Update your My_Sql.
Reply
#3

Quote:
Originally Posted by Faisal_khan
Посмотреть сообщение
Missing a brace here:
pawn Код:
YCMD:unban(playerid, params[], help) {
    if(help) {
        SendClientMessage(playerid, X11_WHITE, "Unbans a player");
        return 1;
    }
    new name[(MAX_PLAYER_NAME*2)+1];
    query[0] = 0;//[256];
    if(sscanf(params,"s[" #MAX_PLAYER_NAME "]",name){
        mysql_real_escape_string(name, name);
        format(query, sizeof(query), "DELETE FROM `bans` WHERE `accountid` = (SELECT `id` FROM `accounts` WHERE `username` = \"%s\")",name);
        mysql_function_query(g_mysql_handle, query, true, "BanDeleteCallback", "dds",playerid, 0, name);
    } else {
        SendClientMessage(playerid, X11_WHITE, "USAGE: /unban [accountname]");
    }
    return 1;
}
nope its not working still, i did replaced it but still giving errors
Quote:

wcrp\admin.pwn(570) : error 001: expected token: ")", but found "-string-"
wcrp\admin.pwn(570) : warning 215: expression has no effect
wcrp\admin.pwn(570) : warning 215: expression has no effect
wcrp\admin.pwn(570) : error 001: expected token: ";", but found ")"
wcrp\admin.pwn(570) : error 029: invalid expression, assumed zero
wcrp\admin.pwn(570) : fatal error 107: too many error messages on one line

Reply
#4

Do you have a string for it ?
Reply
#5

Please use code tags not quote tags to paste your code.

The errors are on another line. Please paste line 570.
Reply
#6

Here she is, line 570
Код:
	if(sscanf(params,"s[" #MAX_PLAYER_NAME "]",name){
Reply
#7

What is that last brace ??!?!?!?
Reply
#8

i did update mysql and idk why that brace doing there..
can you just fix it?
Reply
#9

Got it:
pawn Код:
YCMD:unban(playerid, params[], help)
{
    if(help)
    {
        SendClientMessage(playerid, X11_WHITE, "Unbans a player");
        return 1;
    }
    new name[(MAX_PLAYER_NAME*2)+1];
    query[0] = 0;//[256];
    if(sscanf(params,"s[" #MAX_PLAYER_NAME "]",name)
    mysql_real_escape_string(name, name);
    format(query, sizeof(query), "DELETE FROM `bans` WHERE `accountid` = (SELECT `id` FROM `accounts` WHERE `username` = \"%s\")",name);
    mysql_function_query(g_mysql_handle, query, true, "BanDeleteCallback", "dds",playerid, 0, name);
    else
    {
        SendClientMessage(playerid, X11_WHITE, "USAGE: /unban [accountname]");
    }
    return 1;
}
Reply
#10

still didn't work you need to fix this line
line 572 -_-
Код:
	if(sscanf(params,"s[" #MAX_PLAYER_NAME "]",name)
Код:
wcrp\admin.pwn(572) : error 001: expected token: ")", but found "-string-"
wcrp\admin.pwn(572) : warning 215: expression has no effect
wcrp\admin.pwn(572) : warning 215: expression has no effect
wcrp\admin.pwn(572) : error 001: expected token: ";", but found ")"
wcrp\admin.pwn(572) : error 029: invalid expression, assumed zero
wcrp\admin.pwn(572) : fatal error 107: too many error messages on one line
572 is 570, its changed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)