SA-MP Forums Archive
Giving Perm 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)
+--- Thread: Giving Perm Help ? (/showthread.php?tid=509052)



Giving Perm Help ? - Protonix - 25.04.2014

Hello i want ask a question
Example: i have got bool
Код:
new bool:perm[MAX_PLAYERS];
i want make command that makes perm = true for target player how can i do this ?


Re: Giving Perm Help ? - Dziugsas - 25.04.2014

COMMANDerm(playerid, params[])
{
perm[playerid] = true;
return 1;
}

but its just a command you'll need to use sscanf.


Re: Giving Perm Help ? - Protonix - 25.04.2014

Quote:
Originally Posted by Dziugsas
Посмотреть сообщение
COMMANDerm(playerid, params[])
{
perm[playerid] = true;
return 1;
}

but its just a command you'll need to use sscanf.
i know but im asking how to do for target player and can i do without zcmd ?


Re: Giving Perm Help ? - Dziugsas - 25.04.2014

Код:
CMD:perm(playerid, params[])
{
    new
        targetid;
    if (sscanf(params, "u", targetid))
        return SendClientMessage(playerid, -1, "  Usage: /per <playerid> ");

    if (!IsPlayerConnected(targetid))
        return SendClientMessage(playerid, -1, "  Player is not connected !");

    perm[targetid] = true
    return 1;
}
I think like this.


Re: Giving Perm Help ? - Protonix - 25.04.2014

Код:
C:\Users\User\Desktop\Other Games\yцntem 1 - Kopya\Yeni klasцr\samp03z_svr_R1_win32\gamemodes\server.pwn(203) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\Other Games\yцntem 1 - Kopya\Yeni klasцr\samp03z_svr_R1_win32\gamemodes\server.pwn(203) : error 017: undefined symbol "cmd_perm"
C:\Users\User\Desktop\Other Games\yцntem 1 - Kopya\Yeni klasцr\samp03z_svr_R1_win32\gamemodes\server.pwn(203) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\Other Games\yцntem 1 - Kopya\Yeni klasцr\samp03z_svr_R1_win32\gamemodes\server.pwn(203) : fatal error 107: too many error messages on one line

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


4 Errors.
line 203:
Код:
CMD:perm(playerid, params[])



Re: Giving Perm Help ? - Dziugsas - 25.04.2014

pawn Код:
CMD:perm(playerid, params[])
{
    new targetid;
    if (sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "  Usage: /per <playerid> ");
    if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "  Player is not connected !");
   
    if(perm[playerid] == true)
    {
        perm[playerid] = false;
    }
    else if(perm[playerid] == false)
    {
        perm[playerid] = true;
    }
    return 1;
}
And that's if you want to toggle the permission.


Re: Giving Perm Help ? - KillerStrike23 - 25.04.2014

if you are using dcmd use dcmd_perm
if I helped +rep


Re: Giving Perm Help ? - Protonix - 25.04.2014

no i included zcmd but it gives this error


Re: Giving Perm Help ? - Dziugsas - 25.04.2014

try this
Код:
CMD:perm(playerid, params[])
{
    new targetid;
    if (sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "  Usage: /per <playerid> ");
    if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "  Player is not connected !");
   
    if(perm[playerid] == true)
    {
        perm[playerid] = false;
    }
    else if(perm[playerid] == false)
    {
        perm[playerid] = true;
    }
    return 1;
}
i forgot to put ";"


Re: Giving Perm Help ? - Protonix - 25.04.2014

Dziugsas i have problem on line CMDerm(playerid, params[])