SA-MP Forums Archive
Help with these commands - 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: Help with these commands (/showthread.php?tid=353076)



Help with these commands - RyanPetersons - 22.06.2012

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?


Re: Help with these commands - RyanPetersons - 22.06.2012

Could anyone reply?


Re: Help with these commands - ReneG - 22.06.2012

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.


Re: Help with these commands - RyanPetersons - 22.06.2012

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


Re: Help with these commands - ReneG - 22.06.2012

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.


Re: Help with these commands - [MM]RoXoR[FS] - 22.06.2012

And please move up to sscanf.