Need help with /drag system
#1

Код:
CMD:drag(playerid, params[])
{
    new giveplayerid, giveplayer[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME], string[128], DragOff[MAX_PLAYERS];
    if(sscanf(params,"u",giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE,"USAGE: /drag [playerid]");
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "That Player is offline !");
    if(!ProxDetectorS(3.0, playerid, giveplayerid)) return SendClientMessage(playerid, COLOR_GREY,"That player isn't near you !");
    if(DragOff[giveplayerid] > 0) return SendClientMessage(playerid, COLOR_GREY,"You are already being Dragged!");
    if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_GREY, "You Cannot Drag Yourself!");
    if(IsACop(giveplayerid))
    { return SendClientMessage(playerid, COLOR_GREY,"You can't drag cops"); }
    if(IsACop(playerid))
    {
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "* You are being dragged by %s,", sendername);
        SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
         format(string, sizeof(string), "* You begin to drag %s,", giveplayer);
         SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
         format(string, sizeof(string), "* %s has started to drag %s.", sendername ,giveplayer);
         ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
         TogglePlayerControllable(giveplayerid, 0);
         DragOff[giveplayerid] = playerid;
    }
    else return SendClientMessage(playerid, COLOR_GREY,"You are not a cop");
    return 1;
}
Anyone who can help me? when i'm dragging someone i can't stop drag them.
Reply
#2

*BumP*
Reply
#3

Try this

pawn Код:
CMD:drag,*playerid,*params[]){* * * **new*ID,*string[26+MAX_PLAYER_NAME],string2[20+MAX_PLAYER_NAME];* * * **if(sscanf(params,*"u",*ID))*returnSendClientMessage(playerid,*GREY,*"CMD:/cuff [playerid]");* * * **if(pCuffed[ID]*==*0)*returnSendClientMessage(playerid,*GREY,*"This player must first be cuffed");* * * **if(Dragged[ID]*==*0*&&*Dragging[playerid]*==*0)* * * **{* * * * * * Dragged[ID]*=*1;* * * * * * Dragging[playerid]*=*1;* * * * * * format(string,*sizeof(string),*"You are being dragged by %s.",*RemoveUnderScore(playerid));* * * * * * format(string2,*sizeof(string2),*" You are dragging %s.",*RemoveUnderScore(ID));* * * * * * SCM(playerid,*PURPLE,*string2);* * * * * * SCM(ID,*PURPLE,*string);* * * * draggedtimer[ID]*=*SetTimerEx("Draggingt",*1000,*1,"dd",*playerid,ID);* * * **}* * * **else* * * **{* * * * * * Dragged[ID]*=*0;* * * * * * Dragging[playerid]*=*0;* * * * * * SCM(playerid,*PURPLE,*"You have stopped dragging your target.");* * * * * * SCM(ID,*PURPLE,*"You aren't being dragged anymore.");* * * * * **KillTimer(draggedtimer[ID]);* * * **}* * * **
return*1;}
Reply
#4

Nah, too many errors, can you make each line under each other? don't have it like straight forward
Reply
#5

Try this

pawn Код:
CMD:drag(playerid, params[])
{
    new giveplayerid, giveplayer[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME], string[128], DragOff[MAX_PLAYERS];
    if(sscanf(params,"u",giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE,"USAGE: /drag [playerid]");
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "That Player is offline !");
    if(!ProxDetectorS(3.0, playerid, giveplayerid)) return SendClientMessage(playerid, COLOR_GREY,"That player isn't near you !");
    if(DragOff[giveplayerid] > 0) return SendClientMessage(playerid, COLOR_GREY,"You are already being Dragged!");
    if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_GREY, "You Cannot Drag Yourself!");
    if(IsACop(giveplayerid))
    { return SendClientMessage(playerid, COLOR_GREY,"You can't drag cops"); }
    if(IsACop(giveplayerid))
    {
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "* You are being dragged by %s,", sendername);
        SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
         format(string, sizeof(string), "* You begin to drag %s,", giveplayer);
         SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
         format(string, sizeof(string), "* %s has started to drag %s.", sendername ,giveplayer);
         ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
         TogglePlayerControllable(giveplayerid, 0);
         DragOff[giveplayerid] = playerid;
    }
    else return SendClientMessage(playerid, COLOR_GREY,"You are not a cop");
    return 1;
}
Reply
#6

I'm just getting the message: You are not a cop. and i am
Reply
#7

Edited, use this scripts
Try this

pawn Код:
CMD:drag(playerid, params[])
{
    new giveplayerid, giveplayer[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME], string[128], DragOff[MAX_PLAYERS];
    if(sscanf(params,"u",giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE,"USAGE: /drag [playerid]");
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "That Player is offline !");
    if(!ProxDetectorS(3.0, playerid, giveplayerid)) return SendClientMessage(playerid, COLOR_GREY,"That player isn't near you !");
    if(DragOff[giveplayerid] > 0) return SendClientMessage(playerid, COLOR_GREY,"You are already being Dragged!");
    if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_GREY, "You Cannot Drag Yourself!");
    if(IsACop(giveplayerid))
    { return SendClientMessage(playerid, COLOR_GREY,"You can't drag cops"); }
    if(IsACop(playerid))
    {
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "* You are being dragged by %s,", sendername);
        SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
         format(string, sizeof(string), "* You begin to drag %s,", giveplayer);
         SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
         format(string, sizeof(string), "* %s has started to drag %s.", sendername ,giveplayer);
         ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
         TogglePlayerControllable(giveplayerid, 0);
         DragOff[giveplayerid] = playerid;
    }
    else return SendClientMessage(playerid, COLOR_GREY,"You are not a cop");
    return 1;
}
Reply
#8

I can drag him, but i can't stop drag him..
Reply
#9

Anyone who can help me? when i'm dragging them i can't stop drag them
Reply
#10

do you have stopdrag cmd? I'll fix it if you have it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)