ZCMD - /drag - Help [+Rep]
#1

Alright, so.. Heres the code (everything for the Drag)

[ Command ]
PHP код:
CMD:drag(playeridparams[])
{
        new 
IDstring[26+MAX_PLAYER_NAME], string2[20+MAX_PLAYER_NAME], giveplayerid;
        if(
sscanf(params"u"ID)) return SendClientMessage(playeridCOLOR_WHITE"CMD:/drag [playerid]");
        if(
PlayerCuffed[giveplayerid] == 2) return SendClientMessage(playeridCOLOR_WHITE"This player must first be cuffed");
        if(
Dragged[ID] == && Dragging[playerid] == 0)
        {
            
Dragged[ID] = 1;
            
Dragging[playerid] = 1;
            
format(stringsizeof(string), "You are being dragged by %s."RemoveUnderScore(playerid));
            
format(string2sizeof(string2), " You are dragging %s."RemoveUnderScore(ID));
            
SendClientMessage(playeridPURPLEstring2);
            
SendClientMessage(IDPURPLEstring);
            
draggedtimer[ID] = SetTimerEx("Dragging1"1000true"dd"playerid);
        }
        else
        {
            
Dragged[ID] = 0;
            
Dragging[playerid] = 0;
            
SendClientMessage(playeridPURPLE"You have stopped dragging your target.");
            
SendClientMessage(IDPURPLE"You aren't being dragged anymore.");
            
KillTimer(draggedtimer[ID]);
        }
        return 
1;

PHP код:
forward Dragging1(playeridID);
public 
Dragging1(playeridID)
{
        new 
Float:dXFloat:dYFloat:dZ;
        
GetPlayerPos(playeriddXdYdZ);
        
SetPlayerPos(IDdX+1dYdZ);

and i get this "errors"
PHP код:
(71477) : error 029invalid expressionassumed zero
(71477) : warning 215expression has no effect
(71477) : error 001expected token";"but found "]"
(71477) : error 029invalid expressionassumed zero
(71477) : fatal error 107too many error messages on one line 
Line 71477 is
draggedtimer[ID] = SetTimerEx("Dragging1", 1000, true, "dd", playerid);

Help Please
Reply
#2

pawn Код:
draggedtimer[ID] = SetTimerEx("Dragging1", 1000, false, "dd", playerid);
Also, I'm not sure why you used two integers (dd) for this, could you explain me?
Reply
#3

Honestly i just tested this FS to Learn from it, ermm.. Its at SAMP Forums, ask him LOLS.
So what should i do?
Reply
#4

Maybe try this.

pawn Код:
CMD:drag( playerid, params[] )
{
    new ID, string[64], string2[64];
    if ( sscanf( params, "u", ID ) ) return(SendClientMessage( playerid, COLOR_WHITE, "CMD:/drag [playerid]" ) );
    if ( !PlayerCuffed[ID] ) return(SendClientMessage( playerid, COLOR_WHITE, "This player must first be cuffed" ) );
    if ( !Dragged[ID] && !Dragging[playerid] )
    {
        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 ) );
        SendClientMessage( playerid, PURPLE, string2 );
        SendClientMessage( ID, PURPLE, string );
        draggedtimer[ID] = SetTimerEx( "Dragging1", 1000, true, "dd", playerid, ID );
    } else  {
        Dragged[ID]        = 0;
        Dragging[playerid] = 0;
        SendClientMessage( playerid, PURPLE, "You have stopped dragging your target." );
        SendClientMessage( ID, PURPLE, "You aren't being dragged anymore." );
        KillTimer( draggedtimer[ID] );
    }
    return(1);
}
Also make sure you have a global variable named new draggedtimer[MAX_PLAYERS];
Reply
#5

Same Bloody errors
Quote:

(71477) : error 029: invalid expression, assumed zero
(71477) : warning 215: expression has no effect
(71477) : error 001: expected token: ";", but found "]"
(71477) : error 029: invalid expression, assumed zero
(71477) : fatal error 107: too many error messages on one line

Reply
#6

Quote:
Originally Posted by [RaZ]Hal_Moore
Посмотреть сообщение
Same Bloody errors
Care to show us that line.
Reply
#7

Quote:

draggedtimer[ID] = SetTimerEx( "Dragging1", 1000, true, "dd", playerid, ID );

That
Reply
#8

Try this:

pawn Код:
draggedtimer[ID] = SetTimerEx( "Dragging1", 1000, false, "dd", playerid, ID );
Reply
#9

Are you sure you have this on your script?

pawn Код:
new draggedtimer[MAX_PLAYERS];
If not, then replaced it.
Reply
#10

I get the error
Quote:

error 020: invalid symbol name ""

For the new draggedtimer[MAX_PLAYERS];
Plus old errors didn't disappear
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)