What is this ?! -
nezo2001 - 28.12.2014
[IMG]

[/IMG]
See the chat above.....
where is the rest of the name ??
Here is the code
PHP код:
CMD:ban(playerid, params[])
{
new targetid;
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command");
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "This player is not connected");
if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /ban [id]");
{
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
new admin[MAX_PLAYER_NAME], string1[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, admin, sizeof(admin));
GetPlayerName(targetid, name, sizeof(name));
format(string, sizeof(string), "%s has been banned by an admin %s", name, admin);
SendClientMessageToAll(COLOR_RED, string);
PlayerInfo[targetid][pBan] = 1;
SetTimerEx("KickDelay", 2000, false, "i", playerid);
}
return true;
}
Re: What is this ?! -
Ryz - 28.12.2014
post image
Re: What is this ?! -
JeaSon - 28.12.2014
change string size
pawn Код:
CMD:ban(playerid, params[])
{
new targetid;
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command");
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "This player is not connected");
if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /ban [id]");
{
new name[MAX_PLAYER_NAME], string[32];
new admin[MAX_PLAYER_NAME];
GetPlayerName(playerid, admin, sizeof(admin));
GetPlayerName(targetid, name, sizeof(name));
format(string, sizeof(string), "%s has been banned by an admin %s", name, admin);
SendClientMessageToAll(COLOR_RED, string);
PlayerInfo[targetid][pBan] = 1;
SetTimerEx("KickDelay", 2000, false, "i", playerid);
}
return true;
}
Re: What is this ?! -
nezo2001 - 28.12.2014
All the name disapeared

Please Help !!
Re: What is this ?! -
Facerafter - 28.12.2014
Nvm, didn't read the OP good enough.
Respuesta: What is this ?! -
aoEXE - 28.12.2014
you assigned few cells to the variable!
pawn Код:
CMD:ban(playerid, params[])
{
new targetid;
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command");
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "This player is not connected");
if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /ban [id]");
{
new name[MAX_PLAYER_NAME], string[78];
new admin[MAX_PLAYER_NAME];
GetPlayerName(playerid, admin, sizeof(admin));
GetPlayerName(targetid, name, sizeof(name));
format(string, sizeof(string), "%s has been banned by an admin %s", name, admin);
SendClientMessageToAll(COLOR_RED, string);
PlayerInfo[targetid][pBan] = 1;
SetTimerEx("KickDelay", 2000, false, "i", playerid);
}
return true;
}
Quote:
Originally Posted by Facerafter
Can you show us OnPlayerConnect?
|
really? -_-
Re: What is this ?! -
UltraScripter - 28.12.2014
Why you add another name string??
pawn Код:
new name[MAX_PLAYER_NAME], string[24];
new admin[MAX_PLAYER_NAME], string1[24];
Re: What is this ?! -
Ahmad45123 - 28.12.2014
Try making the string array size bigger.
Here:
pawn Код:
CMD:ban(playerid, params[])
{
new targetid;
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command");
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "This player is not connected");
if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /ban [id]");
{
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME + MAX_PLAYER_NAME ];
new admin[MAX_PLAYER_NAME], string1[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, admin, sizeof(admin));
GetPlayerName(targetid, name, sizeof(name));
format(string, sizeof(string), "%s has been banned by an admin %s", name, admin);
SendClientMessageToAll(COLOR_RED, string);
PlayerInfo[targetid][pBan] = 1;
SetTimerEx("KickDelay", 2000, false, "i", playerid);
}
return true;
}
Re: What is this ?! -
Sawalha - 28.12.2014
string cells aren't enough,
let it be +70 at least.
Re: What is this ?! -
dominik523 - 28.12.2014
Done.