OMG! one command disables another! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OMG! one command disables another! (
/showthread.php?tid=274089)
OMG! one command disables another! -
samtey - 04.08.2011
Hi @ll
Look at these errors!
Код:
D:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\gamemodes\deathmatch.pwn(185) : warning 225: unreachable code
D:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\gamemodes\deathmatch.pwn(185) : error 029: invalid expression, assumed zero
D:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\gamemodes\deathmatch.pwn(185) : error 017: undefined symbol "cmd_kick"
D:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\gamemodes\deathmatch.pwn(185) : error 029: invalid expression, assumed zero
D:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\gamemodes\deathmatch.pwn(185) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
I just added this!
pawn Код:
CMD:og(playerid, params[])
{
new
gangsterlevel, id;
if(PlayerInfo[playerid][pAdmin] >= 3)
{
if(sscanf(params, "ui", id, gangsterlevel)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /set_glevel [id] [gangsterlevel]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "System: Invalid ID");
new
str[128];
format(str,128,"System: %s [ID %d] has set %s [ID %d] gangsterlevel to %i", PlayerName(playerid), playerid, PlayerName(id), id, gangsterlevel);
SendClientMessage(playerid, COLOR_YELLOW, str);
if(INI_Open(getINI(playerid)))
{
INI_WriteInt("GangsterLvl", gangsterlevel);
new
pts = INI_ReadInt("RespectPts");
if(pts <= 90)
{
INI_WriteInt("RespectPts", pts + 10);
}
else
{
INI_WriteInt("RespectPts", 100);
}
INI_Save();
INI_Close();
}
return 1;
}
else return SendClientMessage(playerid,COLOR_RED," You are not allowed to use this command!");
My kick command is fucked up! Until I added, everythin' worked fine!
AW: OMG! one command disables another! -
samtey - 04.08.2011
BUMP! I need help!
Re: OMG! one command disables another! -
Wesley221 - 04.08.2011
pawn Код:
CMD:og(playerid, params[])
{
new
gangsterlevel, id;
if(PlayerInfo[playerid][pAdmin] >= 3)
{
if(sscanf(params, "ui", id, gangsterlevel)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /set_glevel [id] [gangsterlevel]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "System: Invalid ID");
new
str[128];
format(str,128,"System: %s [ID %d] has set %s [ID %d] gangsterlevel to %i", PlayerName(playerid), playerid, PlayerName(id), id, gangsterlevel);
SendClientMessage(playerid, COLOR_YELLOW, str);
if(INI_Open(getINI(playerid)))
{
INI_WriteInt("GangsterLvl", gangsterlevel);
new
pts = INI_ReadInt("RespectPts");
if(pts <= 90)
{
INI_WriteInt("RespectPts", pts + 10);
}
else
{
INI_WriteInt("RespectPts", 100);
}
INI_Save();
INI_Close();
}
return 1;
}
else return SendClientMessage(playerid,COLOR_RED," You are not allowed to use this command!");
}
U forgot a '}' at the end
AW: OMG! one command disables another! -
samtey - 04.08.2011
Ok thanks, but one more thing! If I type /og [id] OG, server writes: USAGE: /og [id] [gangsterlevel]
But when I write /og [id] [any number] It says blah has set blahs gangsterlevel to OG! But I want that it get with OG!
PHP код:
CMD:og(playerid, params[])
{
new
gangsterlevel, id;
if(PlayerInfo[playerid][pAdmin] >= 3)
{
if(sscanf(params, "ui", id, gangsterlevel)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /og [id] [gangsterlevel]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "System: Invalid ID");
new
str[128];
format(str,128,"System: Administrator %s [ID %d] has set %s [ID %d] gangsterlevel to OG", PlayerName(playerid), playerid, PlayerName(id), id, gangsterlevel);
SendClientMessage(playerid, COLOR_YELLOW, str);
if(INI_Open(getINI(playerid)))
{
INI_WriteInt("GangsterLvl", gangsterlevel);
new
pts = INI_ReadInt("RespectPts");
if(pts <= 90)
{
INI_WriteInt("RespectPts", pts + 10);
}
else
{
INI_WriteInt("RespectPts", 100);
}
INI_Save();
INI_Close();
}
return 1;
}
else return SendClientMessage(playerid,COLOR_RED," You are not allowed to use this command!");
}
ANY HELP?
AW: OMG! one command disables another! -
samtey - 04.08.2011
PLS HELP!