Help with these commands
#1

pawn Код:
CMD:pcuff(playerid,params[])
{
    new tmp[128];
    new idx;
    new giveplayerid;
    new giveplayer[MAX_PLAYER_NAME];
    new sendername[MAX_PLAYER_NAME];
    if(!strlen(tmp)) return SendClientMessage(playerid,0xAA3333AA,"USAGE: /cuff playerid");
    giveplayerid = strval(tmp);
    if(!PlayerOrg[playerid] == 4)
    {
    TogglePlayerControllable(giveplayerid,0);
    GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer));
    GetPlayerName(playerid,sendername,sizeof(sendername));
    format(tmp,sizeof(tmp),"You have cuffed %s",giveplayer);
    SendClientMessage(playerid,0x33AA33AA,tmp);
    format(tmp,sizeof(tmp),"You have been cuffed by %s",sendername);
    SendClientMessage(giveplayerid,0xAA3333AA,tmp);
     }
    return 1;
    }
   
CMD:scuff(playerid,params[])
{
    new tmp[128];
    new idx;
    new giveplayerid;
    new giveplayer[MAX_PLAYER_NAME];
    new sendername[MAX_PLAYER_NAME];
    if(!strlen(tmp)) return SendClientMessage(playerid,0xAA3333AA,"USAGE: /cuff playerid");
    giveplayerid = strval(tmp);
    if(!PlayerOrg[playerid] == 5)
    {
    TogglePlayerControllable(giveplayerid,0);
    GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer));
    GetPlayerName(playerid,sendername,sizeof(sendername));
    format(tmp,sizeof(tmp),"You have cuffed %s",giveplayer);
    SendClientMessage(playerid,0x33AA33AA,tmp);
    format(tmp,sizeof(tmp),"You have been cuffed by %s",sendername);
    SendClientMessage(giveplayerid,0xAA3333AA,tmp);
    }
    return 1;
    }
   
CMD:puncuff(playerid,params[])
{
    new tmp[128];
    new idx;
    new giveplayerid;
    new giveplayer[MAX_PLAYER_NAME];
    new sendername[MAX_PLAYER_NAME];
    if(!strlen(tmp)) return SendClientMessage(playerid,0xAA3333AA,"USAGE: /uncuff playerid");
    giveplayerid = strval(tmp);
    if(!PlayerOrg[playerid] == 4)
    {
    TogglePlayerControllable(giveplayerid,1);
    GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer));
    GetPlayerName(playerid,sendername,sizeof(sendername));
    format(tmp,sizeof(tmp),"You have uncuffed %s",giveplayer);
    SendClientMessage(playerid,0x33AA33AA,tmp);
    format(tmp,sizeof(tmp),"You have been uncuffed by %s",sendername);
    SendClientMessage(giveplayerid,0xAA3333AA,tmp);
    }
    return 1;
    }
   
CMD:suncuff(playerid,params[])
{
    new tmp[128];
    new idx;
    new giveplayerid;
    new giveplayer[MAX_PLAYER_NAME];
    new sendername[MAX_PLAYER_NAME];
    if(!strlen(tmp)) return SendClientMessage(playerid,0xAA3333AA,"USAGE: /uncuff playerid");
    giveplayerid = strval(tmp);
    if(!PlayerOrg[playerid] == 5)
    {
    TogglePlayerControllable(giveplayerid,1);
    GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer));
    GetPlayerName(playerid,sendername,sizeof(sendername));
    format(tmp,sizeof(tmp),"You have uncuffed %s",giveplayer);
    SendClientMessage(playerid,0x33AA33AA,tmp);
    format(tmp,sizeof(tmp),"You have been uncuffed by %s",sendername);
    SendClientMessage(giveplayerid,0xAA3333AA,tmp);
    }
    return 1;
    }
CMD:btie(playerid,params[])
{
new otherid;
if(!PlayerOrg[playerid] == 2)
{
    if (sscanf(params, "d", otherid)) return SendClientMessage(playerid, ERROR_COLOR, "Usage: /Tie [playerid]");
    {
        TogglePlayerControllable(otherid, 0);
        SendClientMessage(otherid,COLOR_RED,"You have been tied");
    }
    }
    return 1;
}

CMD:atie(playerid,params[])
{
new otherid;
if(!PlayerOrg[playerid] == 3)
{
    if (sscanf(params, "d", otherid)) return SendClientMessage(playerid, ERROR_COLOR, "Usage: /Tie [playerid]");
    {
        TogglePlayerControllable(otherid, 0);
        SendClientMessage(otherid,COLOR_RED,"You have been tied");
    }
    }
    return 1;
}

CMD:gtie(playerid,params[])
{
new otherid;
if(!PlayerOrg[playerid] == 1)
{
    if (sscanf(params, "d", otherid)) return SendClientMessage(playerid, ERROR_COLOR, "Usage: /Tie [playerid]");
    {
        TogglePlayerControllable(otherid, 0);
        SendClientMessage(otherid,COLOR_RED,"You have been tied");
    }
    }
    return 1;
}

CMD:heal(playerid,params[])
{
new otherid;
if(!PlayerOrg[playerid] == 6)
{
if (sscanf(params, "d", otherid)) return SendClientMessage(playerid, ERROR_COLOR, "Usage: /heal [playerid]");
    {
    SetPlayerHealth(otherid,100);
    }
    }
    return 1;
    }
CMD:guntie(playerid,params[])
{
new otherid;
if(!PlayerOrg[playerid] == 1)
{
    if (sscanf(params, "d", otherid)) return SendClientMessage(playerid, ERROR_COLOR, "Usage: /Tie [playerid]");
    {
        TogglePlayerControllable(otherid, 1);
        SendClientMessage(otherid,COLOR_RED,"You have been untied");
    }
    }
 return 1;
}

CMD:buntie(playerid,params[])
{
new otherid;
if(!PlayerOrg[playerid] == 2)
{
    if (sscanf(params, "d", otherid)) return SendClientMessage(playerid, ERROR_COLOR, "Usage: /Tie [playerid]");
    {
        TogglePlayerControllable(otherid, 1);
        SendClientMessage(otherid,COLOR_RED,"You have been untied");
    }
    }
    return 1;
}

CMD:auntie(playerid,params[])
{
new otherid;
if(!PlayerOrg[playerid] == 3)
{
    if (sscanf(params, "d", otherid)) return SendClientMessage(playerid, ERROR_COLOR, "Usage: /Tie [playerid]");
    {
        TogglePlayerControllable(otherid, 1);
        SendClientMessage(otherid,COLOR_RED,"You have been untied");
    }
    }
    return 1;
}
These commands doesn't works, even I setted myself the leader of every org and tried to use the commands but the commands doesn't works?
Reply
#2

Could anyone reply?
Reply
#3

Could you not bump your own thread in 5 minutes?

As said in a stickied topic, you are not important, especially with all those lines of code you posted that you have no clue about. This thread is for some-what small queries, not a "fix code plx" thread.

EDIT:

Might wanna use sscanf, with ZCMD. Excellent at making these types of commands.
Reply
#4

Okay, but can you fix it? or explain me wat mistake i did?
so, thats why the cmds are not working.
Reply
#5

Do you have any idea what you're doing? Did you make this yourself?

I highly doubt anyone here will fix it for you, but I'll give you a pointer.

The code below.
pawn Код:
if(!PlayerOrg[playerid] == 3)
You don't need the ! The exclamation point is used to check if a value returns zero.

Код:
if(!PlayerOrg[playerid])
Will check if the PlayerOrg is equal to zero. Most likely not in an organisation.

Also, some of this code doesn't even make sense.
pawn Код:
if (sscanf(params, "d", otherid)) return SendClientMessage(playerid, ERROR_COLOR, "Usage: /Tie [playerid]");
{
    TogglePlayerControllable(otherid, 1);
    SendClientMessage(otherid,COLOR_RED,"You have been untied");
}
Look at tutorials, you're not gonna learn this over night or in one post.
Reply
#6

And please move up to sscanf.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)