Author Topic: Non-overwriting !saveloc for GUPS  (Read 3995 times)

0 Members and 1 Guest are viewing this topic.

Offline Kenway

  • Street Thug
  • *
  • Posts: 7
    • View Profile
Non-overwriting !saveloc for GUPS
« on: September 07, 2012, 10:17:46 pm »
Hello,
I've tried many times to make a non overwriting saveloc, but I failed.
Does anyone have it and/or can share with me?
I found this, but I only need the saveloc part, but when I try to compile it gives me errors...
Code: [Select]
#include <a_samp>
#include <core>
#include <float>


function8(arg0, arg1)
{
new File:var0 = 0, File:var1 = 0;
if(!fexist(arg0))
{
return 0;
}
var0 = fopen(arg0, 0);
var1 = fopen(arg1, 1);
new var2[75];
while(fread(var0, var2, 75))
{
function220(var2);
format(var2, 75, "%s\r\n", var2);
fwrite(var1, var2);
}
fclose(var0);
fclose(var1);
return 1;
}

function220(arg0)
{
new var0 = strlen(arg0);
if(!arg0)
{
return 0;
}
if(arg0[var0 - 1] == 10 || arg0[var0 - 1] == 13)
{
arg0[var0 - 1] = 0;
if(!arg0)
{
return 0;
}
if(arg0[var0 - 2] == 10 || arg0[var0 - 2] == 13)
{
arg0[var0 - 2] = 0;
}
}
return 0;
}

function448(arg0, arg1, arg2)
{
new var0[75];
new var1 = 0;
var0[0] = 0;
if(strlen(arg0) <= arg1)
{
return var0;
}
if(strlen(arg0) <= arg2 + arg1)
{
arg2 = strlen(arg0) - arg1;
}
if(0 >= arg2)
{
return var0;
}
for(var1 = arg1; arg2 + arg1 > var1; var1++)
{
var0[var1 - arg1] = arg0[var1];
if(!arg0[var1])
{
return var0;
}
}
var0[arg2] = 0;
return var0;
}

function70C(arg0, arg1)
{
new var0 = strlen(arg1);
new var1 = 0;
for(var1 = 0; var1 < var0; var1++)
{
arg0[var1] = arg1[var1];
}
arg0[var0] = 0;
return 0;
}

function800(arg0, arg1, arg2)
{
if(strlen(arg0) != strlen(arg1))
{
return 0;
}
if(!strcmp(arg0, arg1, arg2))
{
return 1;
}
return 0;
}

function8C4(arg0, &arg1, arg2)
{
new var0 = strlen(arg0);
new var1 = arg1;
new var2[75];
while(arg1 < var0 && arg0[arg1] != arg2 && arg1 - var1 < 74)
{
var2[arg1 - var1] = arg0[arg1];
arg1++;
}
var2[arg1 - var1] = 0;
if(arg1 < var0 && arg0[arg1] == arg2)
{
arg1++;
}
return var2;
}

functionB7C(arg0)
{
new var0[75];
var0[0] = 0;
if(!arg0)
{
return var0;
}
new var1 = 0;
for(var1 = 0; strlen(arg0) > var1; var1++)
{
var0[var1] = tolower(arg0[var1]);
}
var0[strlen(arg0)] = 0;
return var0;
}

functionD34(arg0)
{
new var0[75];
var0[0] = 0;
if(strfind(arg0, "=", true, 0) == -1)
{
return var0;
}
function70C(var0, functionB7C(function448(arg0, 0, strfind(arg0, "=", true, 0))));
return var0;
}

functionEC8(arg0)
{
new var0[75];
var0[0] = 0;
if(strfind(arg0, "=", true, 0) == -1)
{
return var0;
}
function70C(var0, function448(arg0, strfind(arg0, "=", true, 0) + 1, strlen(arg0)));
return var0;
}

function1054(arg0, arg1, arg2)
{
new File:var0 = 0, File:var1 = 0;
new var2 = 0;
new var3[75];
if(!arg1)
{
return 0;
}
format(var3, 75, "%s.part", arg0);
var0 = fopen(arg0, 0);
if(!var0)
{
return 0;
}
fremove(var3);
var1 = fopen(var3, 1);
while(fread(var0, var3, 75))
{
function220(var3);
if(!var2 && function800(functionD34(var3), arg1, true))
{
format(var3, 75, "%s=%s", arg1, arg2);
var2 = 1;
}
fwrite(var1, var3);
fwrite(var1, "\r\n");
}
if(!var2)
{
format(var3, 75, "%s=%s", arg1, arg2);
fwrite(var1, var3);
fwrite(var1, "\r\n");
}
fclose(var0);
fclose(var1);
format(var3, 75, "%s.part", arg0);
if(function8(var3, arg0))
{
return fremove(var3);
}
return 0;
}

function150C(arg0, arg1)
{
new File:var0 = 0;
new var1[75];
new var2[75];
var1[0] = 0;
var0 = fopen(arg0, 0);
if(!var0)
{
return var1;
}
while(fread(var0, var1, 75))
{
function220(var1);
if(function800(functionD34(var1), arg1, true))
{
var2[0] = 0;
strcat(var2, functionEC8(var1), 75);
fclose(var0);
return var2;
}
}
fclose(var0);
return var1;
}

public OnFilterScriptInir()
{
print("Sucessfully started!");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

main()
{
return 0;
}

public OnGameModeInit()
{
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerText(playerid, text)
{
new var0[256];
new var1[128];
new var2 = 0;
var0 = function8C4(text, var2, 32);
if(!strcmp(var0, "!gotolocadmin", true))
{
var1 = function8C4(text, var2, 32);
if(!strlen(var1))
{
SendClientMessage(playerid, 0x33AA33AA, "USAGE: !gotoloc [Name]");
}
if(!IsLocationExist(var1))
{
SendClientMessage(playerid, 0x33AA33AA, "InValid Loc");
}
else
{
GotoLoc(playerid, var1);
}
return 1;
}
if(!strcmp(var0, "!saveloc", true))
{
var1 = function8C4(text, var2, 32);
if(!strlen(var1))
{
SendClientMessage(playerid, 0x04A36BF, "** pm >> USAGE: !saveloc <location>");
}
if(GetLocExists(var1))
{
SendClientMessage(playerid, 0x04A36BF, "** pm >> This location already exists.");
}
else
{
SaveLoc(playerid, var1);
}
return 1;
}
return 0;
}

public GotoLoc(playerid, arg1)
{
new var0[4][128];
new var1[128];
function2354(function150C("/SavedLocations/Locations.ini", arg1), var0, 32);
SetPlayerPos(playerid, floatstr(var0[0]), floatstr(var0[1]), floatstr(var0[2]), 0, 0);
format(var1, 128, "location: %s : (%.4f %.4f %.4f)", arg1);
SendClientMessage(playerid, 0x33AA33AA, var1);
return 1;
}

public SaveLoc(playerid, arg1)
{
new Float:var0 = 0.0, Float:var1 = 0.0, Float:var2 = 0.0, var3[254], var4[256];
new var5[128];
GetPlayerPos(playerid, var0, var1, var2);
GetPlayerName(playerid, var3, 254);
format(var4, 256, "%.4f %.4f %.4f", var0, var1, var2, var3);
function1054("/SavedLocations/Locations.ini", arg1, var4);
format(var5, 128, "Saved As %s Coords = (%.4f %.4f %.4f.)", arg1, var0, var1, var2);
SendClientMessage(playerid, 0x33AA33AA, var5);
return 1;
}

public IsLocationExist(arg0)
{
new var0[128];
var0 = function150C("/SavedLocations/Locations.ini", arg0);
return 1;
}

public GetLocExists(arg0)
{
if(strcmp(var0, "0", true))
{
}
new var0[128];
var0 = function150C("/SavedLocations/Locations.ini", arg0);
return 1;
}

function2354(arg0, arg1, arg2)
{
if(strcmp(var0, "0", true))
{
}
new var0 = 0, var1 = 0;
new var2 = 0;
new var3 = 0;
while(strlen(arg0) >= var0)
{
if(arg0[var0] == arg2 || var0 == strlen(arg0))
{
var3 = strmid(arg1[var2], arg0, var1, var0, 128);
arg1[var2][var3] = 0;
var1 = var0 + 1;
var2++;
}
var0++;
}
return 1;
}

Errors:
Code: [Select]
E:\Legacy VCMP\pawno\new.pwn(8) : warning 213: tag mismatch
E:\Legacy VCMP\pawno\new.pwn(8) : warning 213: tag mismatch
E:\Legacy VCMP\pawno\new.pwn(9) : error 035: argument type mismatch (argument 1)
E:\Legacy VCMP\pawno\new.pwn(13) : error 035: argument type mismatch (argument 1)
E:\Legacy VCMP\pawno\new.pwn(14) : error 035: argument type mismatch (argument 1)
E:\Legacy VCMP\pawno\new.pwn(18) : error 035: argument type mismatch (argument 1)
E:\Legacy VCMP\pawno\new.pwn(25) : warning 203: symbol is never used: "arg1"
E:\Legacy VCMP\pawno\new.pwn(25) : warning 203: symbol is never used: "arg0"
E:\Legacy VCMP\pawno\new.pwn(29) : error 035: argument type mismatch (argument 1)
E:\Legacy VCMP\pawno\new.pwn(34) : error 028: invalid subscript (not an array or too many subscripts): "arg0"
E:\Legacy VCMP\pawno\new.pwn(34) : warning 215: expression has no effect
E:\Legacy VCMP\pawno\new.pwn(34) : error 001: expected token: ";", but found "]"
E:\Legacy VCMP\pawno\new.pwn(34) : error 029: invalid expression, assumed zero
E:\Legacy VCMP\pawno\new.pwn(34) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.0.3367 Copyright (c) 1997-2005, ITB CompuPhase


9 Errors.
I'd really appreciate any help.
Thanks

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Non-overwriting !saveloc for GUPS
« Reply #1 on: September 07, 2012, 10:45:03 pm »
I found this, but I only need the saveloc part, but when I try to compile it gives me errors...
Code: [Select]
#include <a_samp>
#include <core>
#include <float>


function8(arg0, arg1)
{
new File:var0 = 0, File:var1 = 0;
if(!fexist(arg0))
{
return 0;
}
var0 = fopen(arg0, 0);
var1 = fopen(arg1, 1);
new var2[75];
while(fread(var0, var2, 75))
{
function220(var2);
format(var2, 75, "%s\r\n", var2);
fwrite(var1, var2);
}
fclose(var0);
fclose(var1);
return 1;
}

function220(arg0)
{
new var0 = strlen(arg0);
if(!arg0)
{
return 0;
}
if(arg0[var0 - 1] == 10 || arg0[var0 - 1] == 13)
{
arg0[var0 - 1] = 0;
if(!arg0)
{
return 0;
}
if(arg0[var0 - 2] == 10 || arg0[var0 - 2] == 13)
{
arg0[var0 - 2] = 0;
}
}
return 0;
}

function448(arg0, arg1, arg2)
{
new var0[75];
new var1 = 0;
var0[0] = 0;
if(strlen(arg0) <= arg1)
{
return var0;
}
if(strlen(arg0) <= arg2 + arg1)
{
arg2 = strlen(arg0) - arg1;
}
if(0 >= arg2)
{
return var0;
}
for(var1 = arg1; arg2 + arg1 > var1; var1++)
{
var0[var1 - arg1] = arg0[var1];
if(!arg0[var1])
{
return var0;
}
}
var0[arg2] = 0;
return var0;
}

function70C(arg0, arg1)
{
new var0 = strlen(arg1);
new var1 = 0;
for(var1 = 0; var1 < var0; var1++)
{
arg0[var1] = arg1[var1];
}
arg0[var0] = 0;
return 0;
}

function800(arg0, arg1, arg2)
{
if(strlen(arg0) != strlen(arg1))
{
return 0;
}
if(!strcmp(arg0, arg1, arg2))
{
return 1;
}
return 0;
}

function8C4(arg0, &arg1, arg2)
{
new var0 = strlen(arg0);
new var1 = arg1;
new var2[75];
while(arg1 < var0 && arg0[arg1] != arg2 && arg1 - var1 < 74)
{
var2[arg1 - var1] = arg0[arg1];
arg1++;
}
var2[arg1 - var1] = 0;
if(arg1 < var0 && arg0[arg1] == arg2)
{
arg1++;
}
return var2;
}

functionB7C(arg0)
{
new var0[75];
var0[0] = 0;
if(!arg0)
{
return var0;
}
new var1 = 0;
for(var1 = 0; strlen(arg0) > var1; var1++)
{
var0[var1] = tolower(arg0[var1]);
}
var0[strlen(arg0)] = 0;
return var0;
}

functionD34(arg0)
{
new var0[75];
var0[0] = 0;
if(strfind(arg0, "=", true, 0) == -1)
{
return var0;
}
function70C(var0, functionB7C(function448(arg0, 0, strfind(arg0, "=", true, 0))));
return var0;
}

functionEC8(arg0)
{
new var0[75];
var0[0] = 0;
if(strfind(arg0, "=", true, 0) == -1)
{
return var0;
}
function70C(var0, function448(arg0, strfind(arg0, "=", true, 0) + 1, strlen(arg0)));
return var0;
}

function1054(arg0, arg1, arg2)
{
new File:var0 = 0, File:var1 = 0;
new var2 = 0;
new var3[75];
if(!arg1)
{
return 0;
}
format(var3, 75, "%s.part", arg0);
var0 = fopen(arg0, 0);
if(!var0)
{
return 0;
}
fremove(var3);
var1 = fopen(var3, 1);
while(fread(var0, var3, 75))
{
function220(var3);
if(!var2 && function800(functionD34(var3), arg1, true))
{
format(var3, 75, "%s=%s", arg1, arg2);
var2 = 1;
}
fwrite(var1, var3);
fwrite(var1, "\r\n");
}
if(!var2)
{
format(var3, 75, "%s=%s", arg1, arg2);
fwrite(var1, var3);
fwrite(var1, "\r\n");
}
fclose(var0);
fclose(var1);
format(var3, 75, "%s.part", arg0);
if(function8(var3, arg0))
{
return fremove(var3);
}
return 0;
}

function150C(arg0, arg1)
{
new File:var0 = 0;
new var1[75];
new var2[75];
var1[0] = 0;
var0 = fopen(arg0, 0);
if(!var0)
{
return var1;
}
while(fread(var0, var1, 75))
{
function220(var1);
if(function800(functionD34(var1), arg1, true))
{
var2[0] = 0;
strcat(var2, functionEC8(var1), 75);
fclose(var0);
return var2;
}
}
fclose(var0);
return var1;
}

public OnFilterScriptInir()
{
print("Sucessfully started!");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

main()
{
return 0;
}

public OnGameModeInit()
{
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerText(playerid, text)
{
new var0[256];
new var1[128];
new var2 = 0;
var0 = function8C4(text, var2, 32);
if(!strcmp(var0, "!gotolocadmin", true))
{
var1 = function8C4(text, var2, 32);
if(!strlen(var1))
{
SendClientMessage(playerid, 0x33AA33AA, "USAGE: !gotoloc [Name]");
}
if(!IsLocationExist(var1))
{
SendClientMessage(playerid, 0x33AA33AA, "InValid Loc");
}
else
{
GotoLoc(playerid, var1);
}
return 1;
}
if(!strcmp(var0, "!saveloc", true))
{
var1 = function8C4(text, var2, 32);
if(!strlen(var1))
{
SendClientMessage(playerid, 0x04A36BF, "** pm >> USAGE: !saveloc <location>");
}
if(GetLocExists(var1))
{
SendClientMessage(playerid, 0x04A36BF, "** pm >> This location already exists.");
}
else
{
SaveLoc(playerid, var1);
}
return 1;
}
return 0;
}

public GotoLoc(playerid, arg1)
{
new var0[4][128];
new var1[128];
function2354(function150C("/SavedLocations/Locations.ini", arg1), var0, 32);
SetPlayerPos(playerid, floatstr(var0[0]), floatstr(var0[1]), floatstr(var0[2]), 0, 0);
format(var1, 128, "location: %s : (%.4f %.4f %.4f)", arg1);
SendClientMessage(playerid, 0x33AA33AA, var1);
return 1;
}

public SaveLoc(playerid, arg1)
{
new Float:var0 = 0.0, Float:var1 = 0.0, Float:var2 = 0.0, var3[254], var4[256];
new var5[128];
GetPlayerPos(playerid, var0, var1, var2);
GetPlayerName(playerid, var3, 254);
format(var4, 256, "%.4f %.4f %.4f", var0, var1, var2, var3);
function1054("/SavedLocations/Locations.ini", arg1, var4);
format(var5, 128, "Saved As %s Coords = (%.4f %.4f %.4f.)", arg1, var0, var1, var2);
SendClientMessage(playerid, 0x33AA33AA, var5);
return 1;
}

public IsLocationExist(arg0)
{
new var0[128];
var0 = function150C("/SavedLocations/Locations.ini", arg0);
return 1;
}

public GetLocExists(arg0)
{
if(strcmp(var0, "0", true))
{
}
new var0[128];
var0 = function150C("/SavedLocations/Locations.ini", arg0);
return 1;
}

function2354(arg0, arg1, arg2)
{
if(strcmp(var0, "0", true))
{
}
new var0 = 0, var1 = 0;
new var2 = 0;
new var3 = 0;
while(strlen(arg0) >= var0)
{
if(arg0[var0] == arg2 || var0 == strlen(arg0))
{
var3 = strmid(arg1[var2], arg0, var1, var0, 128);
arg1[var2][var3] = 0;
var1 = var0 + 1;
var2++;
}
var0++;
}
return 1;
}

Oh, really, you found that ?

That is a code from a .pwn file decompiled with DeAMX.

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline Kenway

  • Street Thug
  • *
  • Posts: 7
    • View Profile
Re: Non-overwriting !saveloc for GUPS
« Reply #2 on: September 08, 2012, 01:33:10 am »
I found this, but I only need the saveloc part, but when I try to compile it gives me errors...
Code: [Select]
#include <a_samp>
#include <core>
#include <float>


function8(arg0, arg1)
{
new File:var0 = 0, File:var1 = 0;
if(!fexist(arg0))
{
return 0;
}
var0 = fopen(arg0, 0);
var1 = fopen(arg1, 1);
new var2[75];
while(fread(var0, var2, 75))
{
function220(var2);
format(var2, 75, "%s\r\n", var2);
fwrite(var1, var2);
}
fclose(var0);
fclose(var1);
return 1;
}

function220(arg0)
{
new var0 = strlen(arg0);
if(!arg0)
{
return 0;
}
if(arg0[var0 - 1] == 10 || arg0[var0 - 1] == 13)
{
arg0[var0 - 1] = 0;
if(!arg0)
{
return 0;
}
if(arg0[var0 - 2] == 10 || arg0[var0 - 2] == 13)
{
arg0[var0 - 2] = 0;
}
}
return 0;
}

function448(arg0, arg1, arg2)
{
new var0[75];
new var1 = 0;
var0[0] = 0;
if(strlen(arg0) <= arg1)
{
return var0;
}
if(strlen(arg0) <= arg2 + arg1)
{
arg2 = strlen(arg0) - arg1;
}
if(0 >= arg2)
{
return var0;
}
for(var1 = arg1; arg2 + arg1 > var1; var1++)
{
var0[var1 - arg1] = arg0[var1];
if(!arg0[var1])
{
return var0;
}
}
var0[arg2] = 0;
return var0;
}

function70C(arg0, arg1)
{
new var0 = strlen(arg1);
new var1 = 0;
for(var1 = 0; var1 < var0; var1++)
{
arg0[var1] = arg1[var1];
}
arg0[var0] = 0;
return 0;
}

function800(arg0, arg1, arg2)
{
if(strlen(arg0) != strlen(arg1))
{
return 0;
}
if(!strcmp(arg0, arg1, arg2))
{
return 1;
}
return 0;
}

function8C4(arg0, &arg1, arg2)
{
new var0 = strlen(arg0);
new var1 = arg1;
new var2[75];
while(arg1 < var0 && arg0[arg1] != arg2 && arg1 - var1 < 74)
{
var2[arg1 - var1] = arg0[arg1];
arg1++;
}
var2[arg1 - var1] = 0;
if(arg1 < var0 && arg0[arg1] == arg2)
{
arg1++;
}
return var2;
}

functionB7C(arg0)
{
new var0[75];
var0[0] = 0;
if(!arg0)
{
return var0;
}
new var1 = 0;
for(var1 = 0; strlen(arg0) > var1; var1++)
{
var0[var1] = tolower(arg0[var1]);
}
var0[strlen(arg0)] = 0;
return var0;
}

functionD34(arg0)
{
new var0[75];
var0[0] = 0;
if(strfind(arg0, "=", true, 0) == -1)
{
return var0;
}
function70C(var0, functionB7C(function448(arg0, 0, strfind(arg0, "=", true, 0))));
return var0;
}

functionEC8(arg0)
{
new var0[75];
var0[0] = 0;
if(strfind(arg0, "=", true, 0) == -1)
{
return var0;
}
function70C(var0, function448(arg0, strfind(arg0, "=", true, 0) + 1, strlen(arg0)));
return var0;
}

function1054(arg0, arg1, arg2)
{
new File:var0 = 0, File:var1 = 0;
new var2 = 0;
new var3[75];
if(!arg1)
{
return 0;
}
format(var3, 75, "%s.part", arg0);
var0 = fopen(arg0, 0);
if(!var0)
{
return 0;
}
fremove(var3);
var1 = fopen(var3, 1);
while(fread(var0, var3, 75))
{
function220(var3);
if(!var2 && function800(functionD34(var3), arg1, true))
{
format(var3, 75, &quot;%s=%s", arg1, arg2);
var2 = 1;
}
fwrite(var1, var3);
fwrite(var1, "\r\n");
}
if(!var2)
{
format(var3, 75, "%s=%s", arg1, arg2);
fwrite(var1, var3);
fwrite(var1, "\r\n");
}
fclose(var0);
fclose(var1);
format(var3, 75, "%s.part", arg0);
if(function8(var3, arg0))
{
return fremove(var3);
}
return 0;
}

function150C(arg0, arg1)
{
new File:var0 = 0;
new var1[75];
new var2[75];
var1[0] = 0;
var0 = fopen(arg0, 0);
if(!var0)
{
return var1;
}
while(fread(var0, var1, 75))
{
function220(var1);
if(function800(functionD34(var1), arg1, true))
{
var2[0] = 0;
strcat(var2, functionEC8(var1), 75);
fclose(var0);
return var2;
}
}
fclose(var0);
return var1;
}

public OnFilterScriptInir()
{
print("Sucessfully started!");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

main()
{
return 0;
}

public OnGameModeInit()
{
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerText(playerid, text)
{
new var0[256];
new var1[128];
new var2 = 0;
var0 = function8C4(text, var2, 32);
if(!strcmp(var0, "!gotolocadmin", true))
{
var1 = function8C4(text, var2, 32);
if(!strlen(var1))
{
SendClientMessage(playerid, 0x33AA33AA, "USAGE: !gotoloc [Name]");
}
if(!IsLocationExist(var1))
{
SendClientMessage(playerid, 0x33AA33AA, "InValid Loc");
}
else
{
GotoLoc(playerid, var1);
}
return 1;
}
if(!strcmp(var0, "!saveloc", true))
{
var1 = function8C4(text, var2, 32);
if(!strlen(var1))
{
SendClientMessage(playerid, 0x04A36BF, "** pm >> USAGE: !saveloc <location>");
}
if(GetLocExists(var1))
{
SendClientMessage(playerid, 0x04A36BF, "** pm >> This location already exists.");
}
else
{
SaveLoc(playerid, var1);
}
return 1;
}
return 0;
}

public GotoLoc(playerid, arg1)
{
new var0[4][128];
new var1[128];
function2354(function150C("/SavedLocations/Locations.ini", arg1), var0, 32);
SetPlayerPos(playerid, floatstr(var0[0]), floatstr(var0[1]), floatstr(var0[2]), 0, 0);
format(var1, 128, "location: %s : (%.4f %.4f %.4f)", arg1);
SendClientMessage(playerid, 0x33AA33AA, var1);
return 1;
}

public SaveLoc(playerid, arg1)
{
new Float:var0 = 0.0, Float:var1 = 0.0, Float:var2 = 0.0, var3[254], var4[256];
new var5[128];
GetPlayerPos(playerid, var0, var1, var2);
GetPlayerName(playerid, var3, 254);
format(var4, 256, "%.4f %.4f %.4f", var0, var1, var2, var3);
function1054("/SavedLocations/Locations.ini", arg1, var4);
format(var5, 128, "Saved As %s Coords = (%.4f %.4f %.4f.)", arg1, var0, var1, var2);
SendClientMessage(playerid, 0x33AA33AA, var5);
return 1;
}

public IsLocationExist(arg0)
{
new var0[128];
var0 = function150C("/SavedLocations/Locations.ini", arg0);
return 1;
}

public GetLocExists(arg0)
{
if(strcmp(var0, "0", true))
{
}
new var0[128];
var0 = function150C("/SavedLocations/Locations.ini", arg0);
return 1;
}

function2354(arg0, arg1, arg2)
{
if(strcmp(var0, "0", true))
{
}
new var0 = 0, var1 = 0;
new var2 = 0;
new var3 = 0;
while(strlen(arg0) >= var0)
{
if(arg0[var0] == arg2 || var0 == strlen(arg0))
{
var3 = strmid(arg1[var2], arg0, var1, var0, 128);
arg1[var2][var3] = 0;
var1 = var0 + 1;
var2++;
}
var0++;
}
return 1;
}

Oh, really, you found that ?

That is a code from a .pwn file decompiled with DeAMX.
Ow, what do I have to do then?
I really need the saveloc part :/

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Non-overwriting !saveloc for GUPS
« Reply #3 on: September 08, 2012, 12:15:52 pm »
I found this, but I only need the saveloc part, but when I try to compile it gives me errors...
Code: [Select]
#include <a_samp>
#include <core>
#include <float>


function8(arg0, arg1)
{
new File:var0 = 0, File:var1 = 0;
if(!fexist(arg0))
{
return 0;
}
var0 = fopen(arg0, 0);
var1 = fopen(arg1, 1);
new var2[75];
while(fread(var0, var2, 75))
{
function220(var2);
format(var2, 75, "%s\r\n", var2);
fwrite(var1, var2);
}
fclose(var0);
fclose(var1);
return 1;
}

function220(arg0)
{
new var0 = strlen(arg0);
if(!arg0)
{
return 0;
}
if(arg0[var0 - 1] == 10 || arg0[var0 - 1] == 13)
{
arg0[var0 - 1] = 0;
if(!arg0)
{
return 0;
}
if(arg0[var0 - 2] == 10 || arg0[var0 - 2] == 13)
{
arg0[var0 - 2] = 0;
}
}
return 0;
}

function448(arg0, arg1, arg2)
{
new var0[75];
new var1 = 0;
var0[0] = 0;
if(strlen(arg0) <= arg1)
{
return var0;
}
if(strlen(arg0) <= arg2 + arg1)
{
arg2 = strlen(arg0) - arg1;
}
if(0 >= arg2)
{
return var0;
}
for(var1 = arg1; arg2 + arg1 > var1; var1++)
{
var0[var1 - arg1] = arg0[var1];
if(!arg0[var1])
{
return var0;
}
}
var0[arg2] = 0;
return var0;
}

function70C(arg0, arg1)
{
new var0 = strlen(arg1);
new var1 = 0;
for(var1 = 0; var1 < var0; var1++)
{
arg0[var1] = arg1[var1];
}
arg0[var0] = 0;
return 0;
}

function800(arg0, arg1, arg2)
{
if(strlen(arg0) != strlen(arg1))
{
return 0;
}
if(!strcmp(arg0, arg1, arg2))
{
return 1;
}
return 0;
}

function8C4(arg0, &arg1, arg2)
{
new var0 = strlen(arg0);
new var1 = arg1;
new var2[75];
while(arg1 < var0 && arg0[arg1] != arg2 && arg1 - var1 < 74)
{
var2[arg1 - var1] = arg0[arg1];
arg1++;
}
var2[arg1 - var1] = 0;
if(arg1 < var0 && arg0[arg1] == arg2)
{
arg1++;
}
return var2;
}

functionB7C(arg0)
{
new var0[75];
var0[0] = 0;
if(!arg0)
{
return var0;
}
new var1 = 0;
for(var1 = 0; strlen(arg0) > var1; var1++)
{
var0[var1] = tolower(arg0[var1]);
}
var0[strlen(arg0)] = 0;
return var0;
}

functionD34(arg0)
{
new var0[75];
var0[0] = 0;
if(strfind(arg0, "=", true, 0) == -1)
{
return var0;
}
function70C(var0, functionB7C(function448(arg0, 0, strfind(arg0, "=", true, 0))));
return var0;
}

functionEC8(arg0)
{
new var0[75];
var0[0] = 0;
if(strfind(arg0, "=", true, 0) == -1)
{
return var0;
}
function70C(var0, function448(arg0, strfind(arg0, "=", true, 0) + 1, strlen(arg0)));
return var0;
}

function1054(arg0, arg1, arg2)
{
new File:var0 = 0, File:var1 = 0;
new var2 = 0;
new var3[75];
if(!arg1)
{
return 0;
}
format(var3, 75, "%s.part", arg0);
var0 = fopen(arg0, 0);
if(!var0)
{
return 0;
}
fremove(var3);
var1 = fopen(var3, 1);
while(fread(var0, var3, 75))
{
function220(var3);
if(!var2 && function800(functionD34(var3), arg1, true))
{
format(var3, 75, &quot;%s=%s", arg1, arg2);
var2 = 1;
}
fwrite(var1, var3);
fwrite(var1, "\r\n");
}
if(!var2)
{
format(var3, 75, "%s=%s", arg1, arg2);
fwrite(var1, var3);
fwrite(var1, "\r\n");
}
fclose(var0);
fclose(var1);
format(var3, 75, "%s.part", arg0);
if(function8(var3, arg0))
{
return fremove(var3);
}
return 0;
}

function150C(arg0, arg1)
{
new File:var0 = 0;
new var1[75];
new var2[75];
var1[0] = 0;
var0 = fopen(arg0, 0);
if(!var0)
{
return var1;
}
while(fread(var0, var1, 75))
{
function220(var1);
if(function800(functionD34(var1), arg1, true))
{
var2[0] = 0;
strcat(var2, functionEC8(var1), 75);
fclose(var0);
return var2;
}
}
fclose(var0);
return var1;
}

public OnFilterScriptInir()
{
print("Sucessfully started!");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

main()
{
return 0;
}

public OnGameModeInit()
{
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerText(playerid, text)
{
new var0[256];
new var1[128];
new var2 = 0;
var0 = function8C4(text, var2, 32);
if(!strcmp(var0, "!gotolocadmin", true))
{
var1 = function8C4(text, var2, 32);
if(!strlen(var1))
{
SendClientMessage(playerid, 0x33AA33AA, "USAGE: !gotoloc [Name]");
}
if(!IsLocationExist(var1))
{
SendClientMessage(playerid, 0x33AA33AA, "InValid Loc");
}
else
{
GotoLoc(playerid, var1);
}
return 1;
}
if(!strcmp(var0, "!saveloc", true))
{
var1 = function8C4(text, var2, 32);
if(!strlen(var1))
{
SendClientMessage(playerid, 0x04A36BF, "** pm >> USAGE: !saveloc <location>");
}
if(GetLocExists(var1))
{
SendClientMessage(playerid, 0x04A36BF, "** pm >> This location already exists.");
}
else
{
SaveLoc(playerid, var1);
}
return 1;
}
return 0;
}

public GotoLoc(playerid, arg1)
{
new var0[4][128];
new var1[128];
function2354(function150C("/SavedLocations/Locations.ini", arg1), var0, 32);
SetPlayerPos(playerid, floatstr(var0[0]), floatstr(var0[1]), floatstr(var0[2]), 0, 0);
format(var1, 128, "location: %s : (%.4f %.4f %.4f)", arg1);
SendClientMessage(playerid, 0x33AA33AA, var1);
return 1;
}

public SaveLoc(playerid, arg1)
{
new Float:var0 = 0.0, Float:var1 = 0.0, Float:var2 = 0.0, var3[254], var4[256];
new var5[128];
GetPlayerPos(playerid, var0, var1, var2);
GetPlayerName(playerid, var3, 254);
format(var4, 256, "%.4f %.4f %.4f", var0, var1, var2, var3);
function1054("/SavedLocations/Locations.ini", arg1, var4);
format(var5, 128, "Saved As %s Coords = (%.4f %.4f %.4f.)", arg1, var0, var1, var2);
SendClientMessage(playerid, 0x33AA33AA, var5);
return 1;
}

public IsLocationExist(arg0)
{
new var0[128];
var0 = function150C("/SavedLocations/Locations.ini", arg0);
return 1;
}

public GetLocExists(arg0)
{
if(strcmp(var0, "0", true))
{
}
new var0[128];
var0 = function150C("/SavedLocations/Locations.ini", arg0);
return 1;
}

function2354(arg0, arg1, arg2)
{
if(strcmp(var0, "0", true))
{
}
new var0 = 0, var1 = 0;
new var2 = 0;
new var3 = 0;
while(strlen(arg0) >= var0)
{
if(arg0[var0] == arg2 || var0 == strlen(arg0))
{
var3 = strmid(arg1[var2], arg0, var1, var0, 128);
arg1[var2][var3] = 0;
var1 = var0 + 1;
var2++;
}
var0++;
}
return 1;
}

Oh, really, you found that ?

That is a code from a .pwn file decompiled with DeAMX.
Ow, what do I have to do then?
I really need the saveloc part :/

An decompiled version of a .pwn file will never show you the script with all names of variables or arguments added by you.
And from what I see this is a script from samp.

<code>#include <a_samp></code>

Try to compile the saveloc from GUPS to your server.

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline Kenway

  • Street Thug
  • *
  • Posts: 7
    • View Profile
Re: Non-overwriting !saveloc for GUPS
« Reply #4 on: September 08, 2012, 11:06:23 pm »
I found this, but I only need the saveloc part, but when I try to compile it gives me errors...
Code: [Select]
#include <a_samp>
#include <core>
#include <float>


function8(arg0, arg1)
{
new File:var0 = 0, File:var1 = 0;
if(!fexist(arg0))
{
return 0;
}
var0 = fopen(arg0, 0);
var1 = fopen(arg1, 1);
new var2[75];
while(fread(var0, var2, 75))
{
function220(var2);
format(var2, 75, "%s\r\n", var2);
fwrite(var1, var2);
}
fclose(var0);
fclose(var1);
return 1;
}

function220(arg0)
{
new var0 = strlen(arg0);
if(!arg0)
{
return 0;
}
if(arg0[var0 - 1] == 10 || arg0[var0 - 1] == 13)
{
arg0[var0 - 1] = 0;
if(!arg0)
{
return 0;
}
if(arg0[var0 - 2] == 10 || arg0[var0 - 2] == 13)
{
arg0[var0 - 2] = 0;
}
}
return 0;
}

function448(arg0, arg1, arg2)
{
new var0[75];
new var1 = 0;
var0[0] = 0;
if(strlen(arg0) <= arg1)
{
return var0;
}
if(strlen(arg0) <= arg2 + arg1)
{
arg2 = strlen(arg0) - arg1;
}
if(0 >= arg2)
{
return var0;
}
for(var1 = arg1; arg2 + arg1 > var1; var1++)
{
var0[var1 - arg1] = arg0[var1];
if(!arg0[var1])
{
return var0;
}
}
var0[arg2] = 0;
return var0;
}

function70C(arg0, arg1)
{
new var0 = strlen(arg1);
new var1 = 0;
for(var1 = 0; var1 < var0; var1++)
{
arg0[var1] = arg1[var1];
}
arg0[var0] = 0;
return 0;
}

function800(arg0, arg1, arg2)
{
if(strlen(arg0) != strlen(arg1))
{
return 0;
}
if(!strcmp(arg0, arg1, arg2))
{
return 1;
}
return 0;
}

function8C4(arg0, &arg1, arg2)
{
new var0 = strlen(arg0);
new var1 = arg1;
new var2[75];
while(arg1 < var0 && arg0[arg1] != arg2 && arg1 - var1 < 74)
{
var2[arg1 - var1] = arg0[arg1];
arg1++;
}
var2[arg1 - var1] = 0;
if(arg1 < var0 && arg0[arg1] == arg2)
{
arg1++;
}
return var2;
}

functionB7C(arg0)
{
new var0[75];
var0[0] = 0;
if(!arg0)
{
return var0;
}
new var1 = 0;
for(var1 = 0; strlen(arg0) > var1; var1++)
{
var0[var1] = tolower(arg0[var1]);
}
var0[strlen(arg0)] = 0;
return var0;
}

functionD34(arg0)
{
new var0[75];
var0[0] = 0;
if(strfind(arg0, "=", true, 0) == -1)
{
return var0;
}
function70C(var0, functionB7C(function448(arg0, 0, strfind(arg0, "=", true, 0))));
return var0;
}

functionEC8(arg0)
{
new var0[75];
var0[0] = 0;
if(strfind(arg0, "=", true, 0) == -1)
{
return var0;
}
function70C(var0, function448(arg0, strfind(arg0, "=", true, 0) + 1, strlen(arg0)));
return var0;
}

function1054(arg0, arg1, arg2)
{
new File:var0 = 0, File:var1 = 0;
new var2 = 0;
new var3[75];
if(!arg1)
{
return 0;
}
format(var3, 75, "%s.part", arg0);
var0 = fopen(arg0, 0);
if(!var0)
{
return 0;
}
fremove(var3);
var1 = fopen(var3, 1);
while(fread(var0, var3, 75))
{
function220(var3);
if(!var2 && function800(functionD34(var3), arg1, true))
{
format(var3, 75, &quot;%s=%s", arg1, arg2);
var2 = 1;
}
fwrite(var1, var3);
fwrite(var1, "\r\n");
}
if(!var2)
{
format(var3, 75, "%s=%s", arg1, arg2);
fwrite(var1, var3);
fwrite(var1, "\r\n");
}
fclose(var0);
fclose(var1);
format(var3, 75, "%s.part", arg0);
if(function8(var3, arg0))
{
return fremove(var3);
}
return 0;
}

function150C(arg0, arg1)
{
new File:var0 = 0;
new var1[75];
new var2[75];
var1[0] = 0;
var0 = fopen(arg0, 0);
if(!var0)
{
return var1;
}
while(fread(var0, var1, 75))
{
function220(var1);
if(function800(functionD34(var1), arg1, true))
{
var2[0] = 0;
strcat(var2, functionEC8(var1), 75);
fclose(var0);
return var2;
}
}
fclose(var0);
return var1;
}

public OnFilterScriptInir()
{
print("Sucessfully started!");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

main()
{
return 0;
}

public OnGameModeInit()
{
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerText(playerid, text)
{
new var0[256];
new var1[128];
new var2 = 0;
var0 = function8C4(text, var2, 32);
if(!strcmp(var0, "!gotolocadmin", true))
{
var1 = function8C4(text, var2, 32);
if(!strlen(var1))
{
SendClientMessage(playerid, 0x33AA33AA, "USAGE: !gotoloc [Name]");
}
if(!IsLocationExist(var1))
{
SendClientMessage(playerid, 0x33AA33AA, "InValid Loc");
}
else
{
GotoLoc(playerid, var1);
}
return 1;
}
if(!strcmp(var0, "!saveloc", true))
{
var1 = function8C4(text, var2, 32);
if(!strlen(var1))
{
SendClientMessage(playerid, 0x04A36BF, "** pm >> USAGE: !saveloc <location>");
}
if(GetLocExists(var1))
{
SendClientMessage(playerid, 0x04A36BF, "** pm >> This location already exists.");
}
else
{
SaveLoc(playerid, var1);
}
return 1;
}
return 0;
}

public GotoLoc(playerid, arg1)
{
new var0[4][128];
new var1[128];
function2354(function150C("/SavedLocations/Locations.ini", arg1), var0, 32);
SetPlayerPos(playerid, floatstr(var0[0]), floatstr(var0[1]), floatstr(var0[2]), 0, 0);
format(var1, 128, "location: %s : (%.4f %.4f %.4f)", arg1);
SendClientMessage(playerid, 0x33AA33AA, var1);
return 1;
}

public SaveLoc(playerid, arg1)
{
new Float:var0 = 0.0, Float:var1 = 0.0, Float:var2 = 0.0, var3[254], var4[256];
new var5[128];
GetPlayerPos(playerid, var0, var1, var2);
GetPlayerName(playerid, var3, 254);
format(var4, 256, "%.4f %.4f %.4f", var0, var1, var2, var3);
function1054("/SavedLocations/Locations.ini", arg1, var4);
format(var5, 128, "Saved As %s Coords = (%.4f %.4f %.4f.)", arg1, var0, var1, var2);
SendClientMessage(playerid, 0x33AA33AA, var5);
return 1;
}

public IsLocationExist(arg0)
{
new var0[128];
var0 = function150C("/SavedLocations/Locations.ini", arg0);
return 1;
}

public GetLocExists(arg0)
{
if(strcmp(var0, "0", true))
{
}
new var0[128];
var0 = function150C("/SavedLocations/Locations.ini", arg0);
return 1;
}

function2354(arg0, arg1, arg2)
{
if(strcmp(var0, "0", true))
{
}
new var0 = 0, var1 = 0;
new var2 = 0;
new var3 = 0;
while(strlen(arg0) >= var0)
{
if(arg0[var0] == arg2 || var0 == strlen(arg0))
{
var3 = strmid(arg1[var2], arg0, var1, var0, 128);
arg1[var2][var3] = 0;
var1 = var0 + 1;
var2++;
}
var0++;
}
return 1;
}

Oh, really, you found that ?

That is a code from a .pwn file decompiled with DeAMX.
Ow, what do I have to do then?
I really need the saveloc part :/

An decompiled version of a .pwn file will never show you the script with all names of variables or arguments added by you.
And from what I see this is a script from samp.

<code>#include <a_samp></code>

Try to compile the saveloc from GUPS to your server.
I know that, but that one is overwriting...
i need a non-overwriting one :/
like this, but I can't filter it out.