Skip to content

Commit

Permalink
Merge pull request #59 from Pottus/inprogress
Browse files Browse the repository at this point in the history
Merge 'inprogress'
  • Loading branch information
Crayder authored Dec 21, 2017
2 parents 8f43af7 + d053de6 commit 66d9c6c
Show file tree
Hide file tree
Showing 7 changed files with 375 additions and 283 deletions.
Binary file modified filterscripts/tstudio.amx
Binary file not shown.
34 changes: 16 additions & 18 deletions filterscripts/tstudio/cmdbuffer.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,22 @@ OnPlayerKeyStateChangeCMD(playerid,newkeys,oldkeys)
return 0;
}

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(success)
{
// If we need to shift the buffer
if(CommandBuffed[playerid][MAX_COMMAND_BUFFER - 1])
{
// Make every slot, start from slot 2, take the data from the slot before
for(new i = 1; i < MAX_COMMAND_BUFFER; i++)
CommandBuffer[playerid][i] = CommandBuffer[playerid][i - 1];
}

// Insert the command and it's parameters into the buffer
CommandBuffer[playerid][0][0] = EOS;
strcat(CommandBuffer[playerid][0], cmdtext);

return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
print(cmdtext);

// Make every slot, start from slot 2, take the data from the slot before
for(new i = MAX_COMMAND_BUFFER - 1; i > 0; --i) {
//printf("i = %2i 1, CB[i] = %s, CB[i-1] = %s", i, CommandBuffer[playerid][i], CommandBuffer[playerid][i - 1]);
//CommandBuffer[playerid][i] = CommandBuffer[playerid][i - 1];
//printf("i = %2i 2, CB[i] = %s, CB[i-1] = %s", i, CommandBuffer[playerid][i], CommandBuffer[playerid][i - 1]);
format(CommandBuffer[playerid][i], 128, "%s", CommandBuffer[playerid][i - 1]);
}

// Insert the command and it's parameters into the buffer
//CommandBuffer[playerid][0][0] = EOS;
format(CommandBuffer[playerid][0], 128, "%s", cmdtext);

return 0;
}

Expand Down
29 changes: 29 additions & 0 deletions filterscripts/tstudio/menugui.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -1625,6 +1625,35 @@ YCMD:runbind(playerid, arg[], help)
return 1;
}

YCMD:makebind(playerid, arg[], help)
{
if(help)
{
SendClientMessage(playerid, STEALTH_ORANGE, "______________________________________________");
SendClientMessage(playerid, STEALTH_GREEN, "Create a bind out of the specified number of last commands.");
return 1;
}

new index, range;
sscanf(arg, "iI(1)", index, range);

if(0 > index > MAX_CLICK_BINDS) return SendClientMessage(playerid, STEALTH_YELLOW, "Usage /makebind <Bind Index (0-9)> <Number of Commands (1-10)>");
if(1 > range > MAX_COMMAND_BUFFER) return SendClientMessage(playerid, STEALTH_YELLOW, "Usage /makebind <Bind Index (0-9)> <Number of Commands (1-10)>");

for(new x; x < range; x++) {
//CommandBindData[index][x] = CommandBuffer[playerid][range - 1 - x];
format(CommandBindData[index][x], 128, "%s", CommandBuffer[playerid][range - 1 - x]);
printf("%i: %s", x, CommandBindData[index][x]);
}

BindUsed[index] = true;

SendClientMessage(playerid, STEALTH_ORANGE, "______________________________________________");
SendClientMessage(playerid, STEALTH_GREEN, sprintf("%i is now the last %i commands", index, range));

return 1;
}


YCMD:bindeditor(playerid, arg[], help)
{
Expand Down
1 change: 1 addition & 0 deletions filterscripts/tstudio/tsmain.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ OnPlayerKeyStateChangeOEdit(playerid,newkeys,oldkeys)
// player finished editing an object
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
//printf("%i, %i, %i, %i", playerid, objectid, response, GetEditMode(playerid));
switch(GetEditMode(playerid))
{
case EDIT_MODE_OBJECT:
Expand Down
Loading

0 comments on commit 66d9c6c

Please sign in to comment.