Giving Perm Help ?
#1

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 ?
Reply
#2

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

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

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 ?
Reply
#4

Код:
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.
Reply
#5

Код:
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[])
Reply
#6

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.
Reply
#7

if you are using dcmd use dcmd_perm
if I helped +rep
Reply
#8

no i included zcmd but it gives this error
Reply
#9

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 ";"
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)