/makeadmin help
#1

pawn Код:
if(!strcmp(cmdtext[1],"makeadmin",true,9))
        {
        if(!IsPlayerAdmin(playerid)||PlayerInfo[playerid][AdminLevel]<5)return SendClientMessage(playerid,0xFF0000FF,"You're not authorized to use that command");

              new tmpspace = strfind(cmdtext," ",true,11);
              if(!cmdtext[11])return SendClientMessage(playerid,0xFF0000FF,"USAGE: /MakeAdmin <playerid> <admin level>");
              if(!cmdtext[tmpspace+1])return SendClientMessage(playerid,0xFF0000FF,"USAGE: /MakeAdmin <playerid> <admin level>");
              PlayerInfo[strval(cmdtext[11])][AdminLevel]=strval(cmdtext[tmpspace+1]);
              new tmpstring[128];
              GetPlayerName(strval(cmdtext[11]),tmpstring,MAX_PLAYER_NAME);
              format(tmpstring,128,"You made %s AdminLevel %d",tmpstring,strval(cmdtext[tmpspace+1]));
              SendClientMessage(playerid,0xFFFFFFFF,tmpstring);
              GetPlayerName(playerid,tmpstring,MAX_PLAYER_NAME);
              format(tmpstring,128,"%s made you AdminLevel %d",tmpstring,strval(cmdtext[tmpspace+1]));
              return SendClientMessage(strval(cmdtext[11]),0xFFFFFFFF,tmpstring);
             

 }
Код:
C:\Users\Alex\Desktop\Protect the PM\gamemodes\PTPM.pwn(385) : warning 235: public function lacks forward declaration (symbol "OnPlayerPrivmsg")
C:\Users\Alex\Desktop\Protect the PM\gamemodes\PTPM.pwn(424) : warning 217: loose indentation
C:\Users\Alex\Desktop\Protect the PM\gamemodes\PTPM.pwn(426) : error 017: undefined symbol "PlayerInfo"
C:\Users\Alex\Desktop\Protect the PM\gamemodes\PTPM.pwn(426) : warning 215: expression has no effect
C:\Users\Alex\Desktop\Protect the PM\gamemodes\PTPM.pwn(426) : error 001: expected token: ";", but found "]"
C:\Users\Alex\Desktop\Protect the PM\gamemodes\PTPM.pwn(426) : error 029: invalid expression, assumed zero
C:\Users\Alex\Desktop\Protect the PM\gamemodes\PTPM.pwn(426) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
After that, would somebody explain me how can I set a command to each level?
Reply
#2

try use
pInfo not PlayerInfo
and
remove
OnPlayerPrivmsg line
pawn Код:
Warning: This callback was removed in SA-MP 0.3. See below how to create a /pm command.
Reply
#3

pawn Код:
if(!strcmp(cmdtext[1],"makeadmin",true,9))
        {
        if(!IsPlayerAdmin(playerid)||pInfo[playerid][AdminLevel]<5)return SendClientMessage(playerid,0xFF0000FF,"You're not authorized to use that command");

              new tmpspace = strfind(cmdtext," ",true,11);
              if(!cmdtext[11])return SendClientMessage(playerid,0xFF0000FF,"USAGE: /MakeAdmin <playerid> <admin level>");
              if(!cmdtext[tmpspace+1])return SendClientMessage(playerid,0xFF0000FF,"USAGE: /MakeAdmin <playerid> <admin level>");
              pInfo[strval(cmdtext[11])][AdminLevel]=strval(cmdtext[tmpspace+1]);
              new tmpstring[128];
              GetPlayerName(strval(cmdtext[11]),tmpstring,MAX_PLAYER_NAME);
              format(tmpstring,128,"You made %s AdminLevel %d",tmpstring,strval(cmdtext[tmpspace+1]));
              SendClientMessage(playerid,0xFFFFFFFF,tmpstring);
              GetPlayerName(playerid,tmpstring,MAX_PLAYER_NAME);
              format(tmpstring,128,"%s made you AdminLevel %d",tmpstring,strval(cmdtext[tmpspace+1]));
              return SendClientMessage(strval(cmdtext[11]),0xFFFFFFFF,tmpstring);


 }
Quote:

C:\Users\Alex\Desktop\Protect the PM\gamemodes\PTPM.pwn(385) : warning 235: public function lacks forward declaration (symbol "OnPlayerPrivmsg")
C:\Users\Alex\Desktop\Protect the PM\gamemodes\PTPM.pwn(424) : warning 217: loose indentation
C:\Users\Alex\Desktop\Protect the PM\gamemodes\PTPM.pwn(426) : error 017: undefined symbol "pInfo"
C:\Users\Alex\Desktop\Protect the PM\gamemodes\PTPM.pwn(426) : warning 215: expression has no effect
C:\Users\Alex\Desktop\Protect the PM\gamemodes\PTPM.pwn(426) : error 001: expected token: ";", but found "]"
C:\Users\Alex\Desktop\Protect the PM\gamemodes\PTPM.pwn(426) : error 029: invalid expression, assumed zero
C:\Users\Alex\Desktop\Protect the PM\gamemodes\PTPM.pwn(426) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Reply
#4

sorry i didn't read cmd complete !
firstly, are you using this?
pawn Код:
enum PlayerInfo
{
    Adminlevel
}
new pInfo[MAX_PLAYERS][PlayerInfo];
use Zcmd is better than Str
pawn Код:
#include <zcmd>

also define
#include <streamer>
#include <sscanf>
and use this
pawn Код:
CMD:makeadmin(playerid, params[])
{
    new id, level, string[128], string2[128], name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME];

    if(pInfo[playerid][Adminlevel] < 5) return SendClientMessage(playerid, -1, "Nono:You don't have the required level to execute this command");
    if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, -1, "Nana: use /makeadmin [PartOfName/ID] [level]");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "No: That ID isn't connected");
    else
    {
        GetPlayerName(playerid, name, sizeof(name));
        GetPlayerName(id, name2, sizeof(name2));

        pInfo[id][Adminlevel] = level;

        format(string, sizeof(string), "Admin %s has promoted you to admin level %d", name, level);
        format(string2, sizeof(string2), "You have promoted %s to admin level %d", name2, level);

        SendClientMessage(id, -1, string);
        SendClientMessage(playerid, -1, string2);
    }
    return true;
}
i'm sorry if you don't understand me
also
tell me if works
Reply
#5

This is all I got now:

Quote:

C:\Users\Alex\Desktop\Protect the PM\gamemodes\PTPM.pwn(747) : warning 203: symbol is never used: "makeadmin"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Warnings.

And It wouldnt load,

Console:
Quote:

SA-MP Dedicated Server
----------------------
v0.3x-R2, ©2005-2013 SA-MP Team

[23:49:44] filterscripts = "" (string)
[23:49:44]
[23:49:44] Server Plugins
[23:49:44] --------------
[23:49:44] Loaded 0 plugins.

[23:49:44]
[23:49:44] Filterscripts
[23:49:44] ---------------
[23:49:44] Loaded 0 filterscripts.

[23:49:44] Script[gamemodes/PTPM.amx]: Run time error 19: "File or function is not found"
[23:49:44] Number of vehicle models: 0

Reply
#6

did you defined/included
pawn Код:
#include <zcmd>
?add it thats the problem
Reply
#7

Yes Its defined.

Quote:

#include <a_samp>
#include <dini>
#include <streamer>
#include <sscanf2>
#include <zcmd>
Reply
#8

Quote:
Originally Posted by Alex_Obando
Посмотреть сообщение
Yes Its defined.
edited
use
pawn Код:
#include <sscanf2>
use this plugin

"nativechecker"

Update your plugins and re-compile your game mode with new includes .
also
add this as stock
pawn Код:
stock Name(playerid)
{
    new nname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, nname, sizeof(nname));
    return nname;
}
Reply
#9

Nope, not working, downloaded the plugin, placed in plugins folder, recompiled and same error in the cosnole.
Reply
#10

private message sent, C:
talk with me via /pm
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)