Re: Script Request Thread #3
#59

Quote:
Originally Posted by Abernethy
Quote:
Originally Posted by Headucation
Abernethy:
pawn Код:
dcmd_setlevel(playerid,params[])
{
    if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pLevel] >= 5)
    {
        new tmp[256],idx;
        tmp = strtok(params,idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid,COLOR_GREY,"Syntax: /setlevel [playerid] [level]");
            return true;
        }
        new otherid = strval(tmp);
        if(!IsPlayerConnected(otherid))
        {
            SendClientMessage(playerid,COLOR_GREY,"Incorrect playerid.");
            return true;
        }
        tmp = strtok(params,idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid,COLOR_GREY,"Syntax: /setlevel [playerid] [level]");
            return true;
        }
        new level = strval(tmp);
        if(level > 5)
        {
            SendClientMessage(playerid,COLOR_GREY,"The Maximum level is 5");
            return true;
        }
        new string[256], pName[MAX_PLAYER_NAME], pName2[MAX_PLAYER_NAME];
        GetPlayerName(otherid,pName,sizeof(pname));
        GetPlayerName(playerid,pName2,sizeof(pname2));
        format(string,sizeof(string),"%s has made you an administrator (Level: %d)",pName2,level);
        SendClientMessage(otherid,COLOR_YELLOW,string);
        format(string,sizeof(string),"You have made %s an Admin (Level: %d)",pName,level);
        SendClientMessage(playerid,COLOR_YELLOW,string);
        PlayerInfo[otherid][pLevel] = level;
        dUserSetINT(PlayerName(otherid)).("AdminLevel", PlayerInfo[otherid][pLevel]);
        return true;
    }
    else return SendClientMessage(playerid,COLOR_RED,"This is an Admin command only.");
}
You have to define DCMD and have Latest Version of Dini.inc, Also you have to get a Registration system that was made in Dini, so That the people you add as Admin will get their Level saved,

Hope this helps
I just changed the code, to this.
pawn Код:
if (strcmp("/setlevel", cmdtext, true) == 0)
    {
    if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pLevel] >= 5)
    {
        new tmp[256],idx;
        tmp = strtok(params,idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid,COLOR_GREY,"Syntax: /setlevel [playerid] [level]");
            return true;
        }
        new otherid = strval(tmp);
        if(!IsPlayerConnected(otherid))
        {
            SendClientMessage(playerid,COLOR_GREY,"Incorrect playerid.");
            return true;
        }
        tmp = strtok(params,idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid,COLOR_GREY,"Syntax: /setlevel [playerid] [level]");
            return true;
        }
        new level = strval(tmp);
        if(level > 5)
        {
            SendClientMessage(playerid,COLOR_GREY,"The Maximum level is 5");
            return true;
        }
        new string[256], pName[MAX_PLAYER_NAME], pName2[MAX_PLAYER_NAME];
        GetPlayerName(otherid,pName,sizeof(pname));
        GetPlayerName(playerid,pName2,sizeof(pname2));
        format(string,sizeof(string),"%s has made you an administrator (Level: %d)",pName2,level);
        SendClientMessage(otherid,COLOR_RED,string);
        format(string,sizeof(string),"You have made %s an Admin (Level: %d)",pName,level);
        SendClientMessage(playerid,COLOR_RED,string);
        PlayerInfo[otherid][pLevel] = level;
        //dUserSetINT(PlayerName(otherid)).("AdminLevel", PlayerInfo[otherid][pLevel]);
        return true;
    }
    else return SendClientMessage(playerid,COLOR_RED,"This is an Admin command only.");
}
I'm receiving these errors; (I have to go right now, I don't have time to stuff around looking for solutions )

Код:
C:\Users\Madhouse\Desktop\Server\filterscripts\pDonation.pwn(173) : error 017: undefined symbol "params"
C:\Users\Madhouse\Desktop\Server\filterscripts\pDonation.pwn(185) : error 017: undefined symbol "params"
C:\Users\Madhouse\Desktop\Server\filterscripts\pDonation.pwn(198) : error 017: undefined symbol "pname"
C:\Users\Madhouse\Desktop\Server\filterscripts\pDonation.pwn(198) : error 029: invalid expression, assumed zero
C:\Users\Madhouse\Desktop\Server\filterscripts\pDonation.pwn(198) : warning 215: expression has no effect
C:\Users\Madhouse\Desktop\Server\filterscripts\pDonation.pwn(199) : error 017: undefined symbol "pname2"
C:\Users\Madhouse\Desktop\Server\filterscripts\pDonation.pwn(199) : error 029: invalid expression, assumed zero
C:\Users\Madhouse\Desktop\Server\filterscripts\pDonation.pwn(199) : warning 215: expression has no effect
C:\Users\Madhouse\Desktop\Server\filterscripts\pDonation.pwn(172) : warning 203: symbol is never used: "idx"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
1. Change 'params' to 'cmdtext'.

2. new pname[MAX_PLAYER_NAME];

3. new pname2[MAX_PLAYER_NAME];
Reply


Messages In This Thread
Re: Script Request Thread #3 - by clean180ollie - 28.07.2009, 10:14
Re: Script Request Thread #3 - by Dj_maryo1993 - 28.07.2009, 12:30
Re: Script Request Thread #3 - by refshal - 28.07.2009, 16:25
Re: Script Request Thread #3 - by Cio-Rap - 28.07.2009, 17:49
Re: Script Request Thread #3 - by user226 - 28.07.2009, 18:56
Re: Script Request Thread #3 - by refshal - 28.07.2009, 19:02
Re: Script Request Thread #3 - by arnutisz - 28.07.2009, 20:34
Re: Script Request Thread #3 - by [Sk]Noob - 28.07.2009, 21:41
Re: Script Request Thread #3 - by Dj_maryo1993 - 28.07.2009, 21:48
Re: Script Request Thread #3 - by Correlli - 29.07.2009, 00:36
Re: Script Request Thread #3 - by adi360 - 01.08.2009, 09:43
Re: Script Request Thread #3 - by Martin_Smith - 01.08.2009, 13:57
Re: Script Request Thread #3 - by Geekzor - 01.08.2009, 16:10
Re: Script Request Thread #3 - by Mowgli - 01.08.2009, 16:15
Re: Script Request Thread #3 - by Geekzor - 01.08.2009, 16:20
Re: Script Request Thread #3 - by Mowgli - 01.08.2009, 17:20
Re: Script Request Thread #3 - by Correlli - 01.08.2009, 19:39
Re: Script Request Thread #3 - by slip733 - 01.08.2009, 20:35
Re: Script Request Thread #3 - by sora_watson - 01.08.2009, 21:26
Re: Script Request Thread #3 - by Anarkien - 01.08.2009, 21:28
Re: Script Request Thread #3 - by sora_watson - 01.08.2009, 21:57
Re: Script Request Thread #3 - by Anarkien - 01.08.2009, 21:58
Re: Script Request Thread #3 - by Geekzor - 01.08.2009, 23:35
Re: Script Request Thread #3 - by Fabio11 - 01.08.2009, 23:56
Re: Script Request Thread #3 - by UberSocks - 02.08.2009, 00:16
Re: Script Request Thread #3 - by user226 - 02.08.2009, 04:49
Re: Script Request Thread #3 - by Abernethy - 02.08.2009, 04:55
Re: Script Request Thread #3 - by Backwardsman97 - 02.08.2009, 09:53
Re: Script Request Thread #3 - by Paradise671 - 02.08.2009, 13:56
Re: Script Request Thread #3 - by Geekzor - 02.08.2009, 18:39
Re: Script Request Thread #3 - by Yanzl - 16.08.2009, 21:15
Re: Script Request Thread #3 - by Googles - 16.08.2009, 21:44
Re: Script Request Thread #3 - by Backwardsman97 - 17.08.2009, 04:20
Re: Script Request Thread #3 - by illli illlil - 17.08.2009, 08:15
Re: Re: Script Request Thread #3 - by snoob - 17.08.2009, 13:11
Re: Script Request Thread #3 - by Yanzl - 17.08.2009, 15:21
Re: Script Request Thread #3 - by snoob - 17.08.2009, 16:17
Re: Script Request Thread #3 - by Yanzl - 17.08.2009, 17:39
Re: Script Request Thread #3 - by snoob - 17.08.2009, 18:16
Re: Script Request Thread #3 - by Yanzl - 17.08.2009, 19:13
Re: Script Request Thread #3 - by snoob - 17.08.2009, 19:23
Re: Script Request Thread #3 - by Ben_Gale - 18.08.2009, 14:13
Re: Script Request Thread #3 - by Mowgli - 18.08.2009, 16:16
Re: Script Request Thread #3 - by Ben_Gale - 18.08.2009, 16:22
Re: Script Request Thread #3 - by CJ101 - 18.08.2009, 19:39
Gun command - by Benc19 - 19.08.2009, 01:28
Basic admin script.. - by _Vortex - 19.08.2009, 11:36
Re: Basic admin script.. - by refshal - 19.08.2009, 11:57
Re: Basic admin script.. - by _Vortex - 19.08.2009, 12:00
Re: Script Request Thread #3 - by refshal - 19.08.2009, 12:09
Re: Script Request Thread #3 - by _Vortex - 19.08.2009, 12:15
Re: Script Request Thread #3 - by snoob - 19.08.2009, 13:24
Re: Script Request Thread #3 - by _Vortex - 19.08.2009, 15:33
I need a scripter - by _Vortex - 20.08.2009, 10:41
Re: Script Request Thread #3 - by klavins - 20.08.2009, 14:12
Re: Script Request Thread #3 - by _Vortex - 20.08.2009, 15:22
Re: Script Request Thread #3 - by checho322 - 21.08.2009, 04:30
Re: Script Request Thread #3 - by Abernethy - 21.08.2009, 05:55
Re: Script Request Thread #3 - by refshal - 21.08.2009, 08:32
Re: Script Request Thread #3 - by lollie123 - 21.08.2009, 12:18
Re: Script Request Thread #3 - by kman - 11.10.2009, 18:35
Re: Script Request Thread #3 - by Sal_Kings - 11.10.2009, 19:35
Re: Script Request Thread #3 - by Lajko1 - 12.10.2009, 16:13
Re: Script Request Thread #3 - by klavins - 13.10.2009, 18:16
Re: Script Request Thread #3 - by Ritchie999 - 14.10.2009, 21:22
Re: Script Request Thread #3 - by DeltaAirlines12 - 14.10.2009, 23:36
Re: Script Request Thread #3 - by Ritchie999 - 14.10.2009, 23:38
Re: Script Request Thread #3 - by Devine - 14.10.2009, 23:58
Re: Script Request Thread #3 - by DeltaAirlines12 - 14.10.2009, 23:59
Re: Script Request Thread #3 - by Quest123 - 16.10.2009, 08:04
Re: Script Request Thread #3 - by anazhd - 19.10.2009, 20:36
Re: Script Request Thread #3 - by Ritchie999 - 19.10.2009, 20:37
Re: Script Request Thread #3 - by [03]Garsino - 19.10.2009, 20:44
Re: Script Request Thread #3 - by anazhd - 19.10.2009, 20:47
Re: Script Request Thread #3 - by Luka P. - 19.10.2009, 21:14
Re: Script Request Thread #3 - by anazhd - 19.10.2009, 21:23
Re: Script Request Thread #3 - by [ATC]eRaZoR - 19.10.2009, 22:36
Re: Script Request Thread #3 - by Danikov - 20.10.2009, 12:02
Re: Script Request Thread #3 - by MB@ - 20.10.2009, 12:03
Re: Script Request Thread #3 - by Luka P. - 20.10.2009, 12:10
Re: Script Request Thread #3 - by zeli - 24.10.2009, 08:50
Re: Script Request Thread #3 - by Vialpando - 25.10.2009, 09:41
Re: Script Request Thread #3 - by bhuvanesh - 25.10.2009, 13:20
Re: Script Request Thread #3 - by bhuvanesh - 25.10.2009, 13:22
Re: Script Request Thread #3 - by Danikov - 25.10.2009, 13:44
Re: Script Request Thread #3 - by Freddy_Manchez - 25.10.2009, 17:35
My Game Mode Idea , Esacape the Prison - by Anddos - 25.10.2009, 20:14
Re: My Game Mode Idea , Esacape the Prison - by [03]Garsino - 25.10.2009, 20:19
Re: Script Request Thread #3 - by Anddos - 25.10.2009, 20:24
Re: Script Request Thread #3 - by dcgm19 - 27.10.2009, 03:41
Re: Script Request Thread #3 - by DarkClone - 27.10.2009, 09:53
Re: Script Request Thread #3 - by CaHbKo - 27.10.2009, 18:07
Re: Script Request Thread #3 - by Luka P. - 27.10.2009, 18:46
Re: Script Request Thread #3 - by Luka P. - 27.10.2009, 19:06
Re: Script Request Thread #3 - by Scoots - 27.10.2009, 19:09
Re: Script Request Thread #3 - by Camacorn - 28.10.2009, 13:07
Re: Script Request Thread #3 - by [03]Garsino - 28.10.2009, 16:57
Re: Script Request Thread #3 - by Luka P. - 28.10.2009, 17:13
Re: Script Request Thread #3 - by [03]Garsino - 28.10.2009, 17:17
Re: Script Request Thread #3 - by Luka P. - 28.10.2009, 17:23
Re: Script Request Thread #3 - by harryb125 - 31.10.2009, 23:38
Re: Script Request Thread #3 - by Luka P. - 31.10.2009, 23:52
Re: Script Request Thread #3 - by harryb125 - 01.11.2009, 00:29
Re: Script Request Thread #3 - by Luka P. - 01.11.2009, 00:33
Re: Script Request Thread #3 - by harryb125 - 01.11.2009, 01:15
Re: Script Request Thread #3 - by harryb125 - 01.11.2009, 01:21
Re: Script Request Thread #3 - by harryb125 - 01.11.2009, 02:36
Re: Script Request Thread #3 - by kennyist - 01.11.2009, 08:44
Re: Script Request Thread #3 - by blokienl - 01.11.2009, 14:36
Re: Script Request Thread #3 - by blokienl - 01.11.2009, 14:36
Re: Script Request Thread #3 - by Nameless303 - 01.11.2009, 23:27
Script Request Thread #3 - by Veinara - 02.11.2009, 04:48
Re: Script Request Thread #3 - by harryb125 - 02.11.2009, 08:32
Re: Script Request Thread #3 - by Ritchie999 - 02.11.2009, 14:16
Re: Script Request Thread #3 - by Luka P. - 02.11.2009, 15:00
Re: Script Request Thread #3 - by Ritchie999 - 02.11.2009, 15:05
Re: Script Request Thread #3 - by SaYrOn - 02.11.2009, 15:53
Re: Script Request Thread #3 - by MenaceX^ - 02.11.2009, 16:07
Re: Script Request Thread #3 - by Ritchie999 - 02.11.2009, 16:14
Re: Script Request Thread #3 - by WardenCS - 02.11.2009, 17:29
Re: Script Request Thread #3 - by MenaceX^ - 07.11.2009, 15:59
Re: Script Request Thread #3 - by W1nsToN - 07.11.2009, 17:04
Re: Script Request Thread #3 - by killer98p - 07.11.2009, 18:49
Re: Script Request Thread #3 - by Redgie - 07.11.2009, 20:05
Re: Script Request Thread #3 - by W1nsToN - 08.11.2009, 11:36
Re: Script Request Thread #3 - by mehmoodali - 09.11.2009, 07:39
Re: Script Request Thread #3 - by Luka P. - 09.11.2009, 17:19
Re: Script Request Thread #3 - by kintama - 09.11.2009, 20:07
Re: Script Request Thread #3 - by mehmoodali - 10.11.2009, 03:21
Re: Script Request Thread #3 - by retart441 - 10.11.2009, 03:36
Re: Script Request Thread #3 - by kintama - 10.11.2009, 10:16
Re: Script Request Thread #3 - by Camacorn - 10.11.2009, 10:19
Re: Script Request Thread #3 - by Gangsta50 - 10.11.2009, 12:53
Re: Script Request Thread #3 - by Correlli - 10.11.2009, 13:03
Re: Script Request Thread #3 - by (.Aztec); - 10.11.2009, 16:01
Re: Script Request Thread #3 - by Camacorn - 10.11.2009, 18:32
Re: Script Request Thread #3 - by (.Aztec); - 11.11.2009, 21:06
Re: Script Request Thread #3 - by Camacorn - 12.11.2009, 00:55
Re: Re: Script Request Thread #3 - by LarzI - 12.11.2009, 01:34
Re: Script Request Thread #3 - by Ironboy500 - 12.11.2009, 05:31
Re: Script Request Thread #3 - by Lynax - 12.11.2009, 12:05
Re: Script Request Thread #3 - by Jakku - 12.11.2009, 12:07
Re: Script Request Thread #3 - by Lajko1 - 12.11.2009, 12:56
Re: Script Request Thread #3 - by Camacorn - 12.11.2009, 13:02
Re: Script Request Thread #3 - by Lilcuete - 12.11.2009, 20:09
Re: Script Request Thread #3 - by Gangsta50 - 13.11.2009, 06:09
Re: Script Request Thread #3 - by Luka P. - 13.11.2009, 13:19
Re: Script Request Thread #3 - by Lajko1 - 13.11.2009, 13:46
Re: Script Request Thread #3 - by Backwardsman97 - 13.11.2009, 20:44
Re: Script Request Thread #3 - by Luka P. - 14.11.2009, 11:42
Re: Script Request Thread #3 - by jameskmonger - 14.11.2009, 11:48
Re: Script Request Thread #3 - by Lynax - 14.11.2009, 16:35
Re: Script Request Thread #3 - by Peter_Corneile - 14.11.2009, 16:39
Re: Script Request Thread #3 - by Jofi - 16.11.2009, 13:01
Re: Script Request Thread #3 - by killer98p - 16.11.2009, 13:10
Re: Script Request Thread #3 - by [03]Garsino - 16.11.2009, 13:14
Re: Script Request Thread #3 - by Ritchie999 - 16.11.2009, 13:19
Re: Script Request Thread #3 - by killer98p - 16.11.2009, 13:38
Re: Script Request Thread #3 - by Ritchie999 - 16.11.2009, 13:55
Re: Script Request Thread #3 - by killer98p - 16.11.2009, 16:37
Re: Script Request Thread #3 - by Correlli - 30.12.2009, 17:12
Re: Script Request Thread #3 - by Luka P. - 30.12.2009, 17:13
Re: Script Request Thread #3 - by snabbo - 31.12.2009, 09:56
Re: Re: Script Request Thread #3 - by ded - 31.12.2009, 10:43
Re: Script Request Thread #3 - by Hijolion - 01.01.2010, 03:25
Re: Script Request Thread #3 - by [03]Garsino - 01.01.2010, 03:27
Re: Script Request Thread #3 - by Hijolion - 01.01.2010, 03:28
Re: Re: Script Request Thread #3 - by LarzI - 01.01.2010, 03:47
Re: Script Request Thread #3 - by Vialpando - 01.01.2010, 12:02
Re: Script Request Thread #3 - by ~Dangun! - 01.01.2010, 20:54
Re: Re: Script Request Thread #3 - by Hijolion - 04.01.2010, 20:38
Re: Script Request Thread #3 - by Zimon95 - 04.01.2010, 20:53
Re: Script Request Thread #3 - by Hijolion - 04.01.2010, 23:17
Re: Script Request Thread #3 - by Guso - 05.01.2010, 05:09
Re: Script Request Thread #3 - by Correlli - 05.01.2010, 05:16
Re: Script Request Thread #3 - by [03]Garsino - 05.01.2010, 15:27
Re: Re: Script Request Thread #3 - by dugi - 05.01.2010, 16:08

Forum Jump:


Users browsing this thread: 8 Guest(s)