09.09.2012, 15:02
Oh, no. I have 3 more bugs.. (included the tazer command. :S)
----------------------------
The first bug:
Line 2275 on ladmin4v2:
dcmd(register, 8, cmdtext); (Under the OnPlayerCommandText)
The register command:
----------------------------
The second bug:
[debug] Run time error 5: "Invalid memory access"
[debug] AMX backtrace:
[debug] #0 00009f34 in public OnPlayerCommandText (playerid=9, cmdtext[]=@0x000226f0 "") at D:\Program Files (x86)\Rockstar Games\server1\filterscripts\FS.pwn:242
Line 242 on FS.pwn:
dcmd(contract,8,cmdtext);
The command:
----------------------------
And the third problem still the tazer command.
The error code:
The command:
----------------------------
Somebody and ideas?
----------------------------
The first bug:
Code:
[debug] Run time error 5: "Invalid memory access" [debug] AMX backtrace: [debug] #0 0001964c in public OnPlayerCommandText (playerid=9, cmdtext[]=@0x000a2850 "") at D:\Program Files (x86)\Rockstar Games\server1\filterscripts\ladmin4v2.pwn:2275
Line 2275 on ladmin4v2:
dcmd(register, 8, cmdtext); (Under the OnPlayerCommandText)
The register command:
Code:
dcmd_register(playerid,params[]) { if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,red,"ACCOUNT: You are already logged in!"); if (strlen(params) < 4 || strlen(params) > 20) return SendClientMessage(playerid,red,"ACCOUNT: The password lenght is incorrect!"); if(!strlen(params)) return SendClientMessage(playerid, red, "ACCOUNT: USAGE: /register password"); if (udb_Create(PlayerName2(playerid),params)) { new Rfile[256],name[MAX_PLAYER_NAME], Rtmp3[100]; GetPlayerName(playerid,name,sizeof(name)); format(Rfile,sizeof(Rfile),"/ladmin/users/%s.sav",udb_encode(name)); dini_Set(Rfile,"password",params); GetPlayerIp(playerid,Rtmp3,100); dini_Set(Rfile,"ip",Rtmp3); dUserSetINT(PlayerName2(playerid)).("registered",1); new strdate[20], year,month,day; getdate(year, month, day); format(strdate, sizeof(strdate), "%d/%d/%d",year,month,day); dini_Set(Rfile,"RegisteredDate",strdate); dUserSetINT(PlayerName2(playerid)).("loggedin",1); dUserSetINT(PlayerName2(playerid)).("banned",0); dUserSetINT(PlayerName2(playerid)).("level",0); dUserSetINT(PlayerName2(playerid)).("LastOn",0); dUserSetINT(PlayerName2(playerid)).("money",0); dUserSetINT(PlayerName2(playerid)).("kills",0); dUserSetINT(PlayerName2(playerid)).("deaths",0); dUserSetINT(PlayerName2(playerid)).("hours",0); dUserSetINT(PlayerName2(playerid)).("minutes",0); dUserSetINT(PlayerName2(playerid)).("seconds",0); dUserSetINT(PlayerName2(playerid)).("score",0); PlayerInfo[playerid][LoggedIn] = 1; PlayerInfo[playerid][Registered] = 1; SendClientMessage(playerid, green, "ACCOUNT: Successful registration!"); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); } return 1; }
----------------------------
The second bug:
[debug] Run time error 5: "Invalid memory access"
[debug] AMX backtrace:
[debug] #0 00009f34 in public OnPlayerCommandText (playerid=9, cmdtext[]=@0x000226f0 "") at D:\Program Files (x86)\Rockstar Games\server1\filterscripts\FS.pwn:242
Line 242 on FS.pwn:
dcmd(contract,8,cmdtext);
The command:
Code:
dcmd_contract(playerid,params[]) { new tmp[128],tmp2[256],idx,val; new id = strval(params); tmp=strtok(params,idx); tmp2=strtok(params,idx); id=strval(tmp); val=strval(tmp2); if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp) || !IsNumeric(tmp2)) { return SendClientMessage(playerid,COLOR_YELLOW,"USAGE: /contract [id] [/contract price = more than 1000$]"); } else if(!IsPlayerConnected(id)) { return SendClientMessage(playerid,COLOR_RED,"Incorrect ID!"); } else if(val>GetPlayerMoney(playerid) || val<1000){ return SendClientMessage(playerid,COLOR_RED,"You don't have 1000$! (the minimum price!)"); } else if(playerid==id) { return SendClientMessage(playerid,COLOR_RED,"Try it an other ID! (It's you!)"); } else if(verdij[id]==1) { return SendClientMessage(playerid,COLOR_RED,"You have already called the hitman!"); } else { new String[255], pName[MAX_PLAYER_NAME], kName[MAX_PLAYER_NAME]; bMoney[id]=val; verdij[id]=1; GetPlayerName(playerid,kName,sizeof(kName)); GetPlayerName(id,pName,sizeof(pName)); format(String,sizeof(String),"[CONTRACT]: %s called a hitman. Target person: %s [Price: $ %d]",kName,pName,val); SendClientMessageToAll(COLOR_YELLOW,String); GivePlayerMoney(playerid,-val); } return 1; }
----------------------------
And the third problem still the tazer command.
The error code:
Code:
[debug] Run time error 5: "Invalid memory access" [debug] AMX backtrace: [debug] #0 00032b40 in public OnPlayerCommandText (playerid=9, cmdtext[]=@0x001664b0 "") at D:\Program Files (x86)\Rockstar Games\server1\gamemodes\Gamemode.pwn:5008
The command:
Code:
dcmd_tazer(playerid, params[]) { new Float:X, Float:Y, Float:Z, player1; if(sscanf(params,"u", player1)) return SendClientMessage(playerid, 0xFF0000AA, "[ERROR] USAGE: /tazer [id]"); if(player1 == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "[ERROR] This player is offline!"); if(IsCuffed[player1] == 1) return SendClientMessage(playerid, 0xFF0000AA, "[ERROR] This player already shocked!"); if(gTeam[playerid] != TEAM_COP && gTeam[playerid] != SWAT) { SendClientMessage(playerid,COLOR_RED,"You are not a Police Unit!"); return 1; } GetPlayerPos(player1, X, Y, Z); if(IsPlayerInRangeOfPoint(playerid, 20.0, X, Y, Z)) { TogglePlayerControllable(player1, false); IsTazed[player1] = 1; GameTextForPlayer(player1, "~r~ Shocked!", 4000, 4); SetTimerEx("tazertimer", 7000, false, "u", player1); SendClientMessage(playerid, 0xFF0000AA, "{00FF00}[SUCCESSFUL SHOCKED!]"); SendClientMessage(player1, 0xFF0000AA, "{FF0000}You have shocked by a Police Unit!"); } return 1; }
Somebody and ideas?