SA-MP Forums Archive
[HELP] - 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: [HELP] (/showthread.php?tid=199431)



[HELP] - Mr Rash - 15.12.2010

I tried adding /skick2 command to be used by helpers level 1336+ to kick hackes when admins are offline etc...
Here's the command

Quote:
Originally Posted by Mr Rash
Посмотреть сообщение
I tried adding /skick2 command to be used by helpers level 1336+ to kick hackes when admins are offline etc...
Here's the command

if(strcmp(cmd, "/skick2", true) ==0)
{
if(IsPlayerConnected(giveplayerid) )
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /skick2 [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerNPC(giveplayerid)) return 1;
if(PlayerInfo[playerid][pHelper] >= 1336)
{
if(IsPlayerConntected(giveplayerid))
{
if(giveplayerid != INVAILD_PLAYER_ID)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(PlayerInfo[giveplayerid][pHelper] > PlayerInfo[playerid][pHelper])
{
format(string, sizeof(string), "HelpCmd: %s was Hskicked, reason: Attempting to silent kick a higher level Helper/Admin.", Sendername);
ABroadCast(COLOR_LIGHTGREEN, string, 1);
Kick(playerid);
return 1;
}
format(string, sizeof(string),"HelpCmd: %s was Hskicked by %s", giveplayer,sendername);
ABroadCast(COLOR_LIGHTGREEN, string, 1);
Kick(giveplayerid);
}
}
else
{
format(string, sizeof(string), " That player is offline or you mistyped its name!", giveplayerid);
SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
}
}
else
{

SendClientMessage(playerid, COLOR_LIGHTGREEN, " You are not authorized to use that command !");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTGREEN, " You are not authorized to use that command !");
}
}
return 1;
}

ERRORS:
C:\Documents and Settings\ЗдУ ИСЯЗК\My Documents\My Received Files\GTA-RLRP.pwn(31745) : error 017: undefined symbol "IsPlayerConntected"
C:\Documents and Settings\ЗдУ ИСЯЗК\My Documents\My Received Files\GTA-RLRP.pwn(31747) : error 017: undefined symbol "INVAILD_PLAYER_ID"
C:\Documents and Settings\ЗдУ ИСЯЗК\My Documents\My Received Files\GTA-RLRP.pwn(31753) : error 017: undefined symbol "Sendername"
C:\Documents and Settings\ЗдУ ИСЯЗК\My Documents\My Received Files\GTA-RLRP.pwn(31774) : error 029: invalid expression, assumed zero
ERRORS:
C:\Documents and Settings\ЗдУ ИСЯЗК\My Documents\My Received Files\GTA-RLRP.pwn(31745) : error 017: undefined symbol "IsPlayerConntected"
C:\Documents and Settings\ЗдУ ИСЯЗК\My Documents\My Received Files\GTA-RLRP.pwn(31747) : error 017: undefined symbol "INVAILD_PLAYER_ID"
C:\Documents and Settings\ЗдУ ИСЯЗК\My Documents\My Received Files\GTA-RLRP.pwn(31753) : error 017: undefined symbol "Sendername"
C:\Documents and Settings\ЗдУ ИСЯЗК\My Documents\My Received Files\GTA-RLRP.pwn(31774) : error 029: invalid expression, assumed zero


Re: [HELP] - Mr Rash - 15.12.2010

Please if you know how to fix it copy the command and fix it then paste it please...


Re: [HELP] - XePloiT - 15.12.2010

this code is such a mass... i'll fix it when i'll come back home...


Re: [HELP] - Mr Rash - 16.12.2010

Help me fixing this CMD please

I need it due to my low number of admins and biger number of helpers they can kick hackers while no admins on


Re: [HELP] - Benjo - 16.12.2010

Just look carefully at your errors:

C:\Documents and Settings\ЗдУ ИСЯЗК\My Documents\My Received Files\GTA-RLRP.pwn(31745) : error 017: undefined symbol "IsPlayerConntected"
You have misspelt IsPlayerConnected on line 31745

C:\Documents and Settings\ЗдУ ИСЯЗК\My Documents\My Received Files\GTA-RLRP.pwn(31747) : error 017: undefined symbol "INVAILD_PLAYER_ID"
You have misspelt INVALID_PLAYER_ID on line 31747

C:\Documents and Settings\ЗдУ ИСЯЗК\My Documents\My Received Files\GTA-RLRP.pwn(31753) : error 017: undefined symbol "Sendername"
You have misspelt (incorrectly capitalised the 's') sendername on line 31753

C:\Documents and Settings\ЗдУ ИСЯЗК\My Documents\My Received Files\GTA-RLRP.pwn(31774) : error 029: invalid expression, assumed zero
Might go away after fixing the above errors, or could be due to using too many or too little brackets '{' or '}'. If it is the latter, properly indenting your code will help you greatly in finding the missing/extra bracket.


Re: [HELP] - alpha500delta - 16.12.2010

I believe this is a fixed version (applied all fixes that Benjo said)

Sorry for crappy indentation

pawn Код:
if(strcmp(cmd, "/skick2", true) ==0)
{
    if(IsPlayerConnected(giveplayerid) )
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /skick2 [playerid/PartOfName]");
    return 1;
   }
    giveplayerid = ReturnUser(tmp);
    if(IsPlayerNPC(giveplayerid)) return 1;
    if(PlayerInfo[playerid][pHelper] >= 1336)
    {
        if(IsPlayerConnected(giveplayerid))
        {
             if(giveplayerid != INVALID_PLAYER_ID)
        {
        GetPlayerName(playerid, sendername, sizeof(sendername));
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        if(PlayerInfo[giveplayerid][pHelper] > PlayerInfo[playerid][pHelper])
        {
        format(string, sizeof(string), "HelpCmd: %s was Hskicked, reason: Attempting to silent kick a higher level  Helper/Admin.", sendername);
        ABroadCast(COLOR_LIGHTGREEN, string, 1);
        Kick(playerid);
       return 1;
}
     format(string, sizeof(string),"HelpCmd: %s was Hskicked by %s", giveplayer,sendername);
     ABroadCast(COLOR_LIGHTGREEN, string, 1);
     Kick(giveplayerid);
    }
}
else
{
    format(string, sizeof(string), " That player is offline or you mistyped its name!", giveplayerid);
    SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
    }
}
else
{

    SendClientMessage(playerid, COLOR_LIGHTGREEN, " You are not authorized to use that command !");
    }
}
    else
{
    SendClientMessage(playerid, COLOR_LIGHTGREEN, " You are not authorized to use that command !");
    }
}
return 1;
}



Re: [HELP] - Mr Rash - 16.12.2010

Thanks for help but i findthe problem and fixed it the problem was that i mis typed some words and added extra values