Drag CMD Warning
#1

warning 204: symbol is assigned a value that is never used: "string"

pawn Код:
CMD:drag(playerid, params[])
{
    new string[128], giveplayerid;
    if(IsACop(playerid) || (PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 5) || PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 2 || (PlayerInfo[playerid][pFaction] == 3 && PlayerInfo[playerid][pRank] >= 10))
    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /drag [playerid/partofname]");
    if(PlayerCuffed[giveplayerid] == 1) return SendClientMessage(playerid, COLOR_WHITE, "This player must first be cuffed");
    if(Dragged[playerid] == 0 && Drag[playerid] == 0)
    Dragged[playerid] = 1;
    Drag[playerid] = 1;
    return 1;
}
Reply
#2

What does it say? That string is never used. So..

• either format a message and send it (using string).
• or remove "string[128], " from the code if you're not going to use it anywhere in that command.
Reply
#3

Found another problem: error 001: expected token: ")", but found "return"

pawn Код:
if(ProxDetectorS(5.0, playerid, giveplayerid) return SendClientMessage(playerid, COLOR_WHITE, "That player isn't near you.");
Reply
#4

You did not close the parantheses at the end of the if statement (before return).
pawn Код:
if(ProxDetectorS(5.0, playerid, giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "That player isn't near you.");
Reply
#5

Anyway, I can't drag em.
pawn Код:
CMD:drag(playerid, params[])
{
    new giveplayerid;
    if(IsACop(playerid) || (PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 5) || PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 2 || (PlayerInfo[playerid][pFaction] == 3 && PlayerInfo[playerid][pRank] >= 10))
    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /drag [playerid/partofname]");
    if(PlayerCuffed[giveplayerid] == 1) return SendClientMessage(playerid, COLOR_WHITE, "This player must first be cuffed");
    if(!ProxDetectorS(3.0, playerid, giveplayerid))
    {
        SendClientMessage(playerid, COLOR_GREY, "That player isn't near you.");
        return 1;
    }
    if(Dragged[playerid] == 0 && Drag[playerid] == 0)
    Dragged[playerid] = 1;
    Drag[playerid] = 1;
    return 1;
}

CMD:stopdrag (playerid, params[])
{
    if(IsACop(playerid) || (PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 5) || PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 2 || (PlayerInfo[playerid][pFaction] == 3 && PlayerInfo[playerid][pRank] >= 10))
    Dragged[playerid] = 0;
    Drag[playerid] = 0;
    {
    return 1;
    }
}

//DRAG
forward Draggingt(playerid, ID);
public Draggingt(playerid, ID)
{
new Float:dX, Float:dY, Float:dZ;
GetPlayerPos(playerid, dX, dY, dZ);
SetPlayerPos(ID, dX+1, dY, dZ);
}
Reply
#6

Erm, it should be using a timer for that.
Reply
#7

I don't want to use timer. How to remove the timer scripts?
Reply
#8

This is the timer's callback:
pawn Код:
//DRAG
forward Draggingt(playerid, ID);
public Draggingt(playerid, ID)
{
new Float:dX, Float:dY, Float:dZ;
GetPlayerPos(playerid, dX, dY, dZ);
SetPlayerPos(ID, dX+1, dY, dZ);
}
What do you want to do anyways?
Reply
#9

Just normal drag system, please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)