24.06.2011, 03:53
Well, im trying to make a command with /stats, but all of them i get errors.....
I try to use this command... and it wont work... Im a new scripter, new with Dcmd, but it wont work.. the errors and stuff i get:
This is mostly all the information you really need...
--------------------------------------------------
if you need more information please tell me...
also, please dont be harsh, im new scripter and REALLY new to dcmd...
my english is bad too.
Thank you if you can help
pawn Код:
dcmd(stats,4,cmdtext);
dcmd_stats(playerid,params[])
{
new params[100]
new string[128];
new name[MAX_PLAYER_NAME],Cash;
name = GetPlayerName(playerid, name, sizeof(name));
playerid = strval(params);
Cash = GetPlayerMoney(playerid);
format(string, sizeof(string), "|Account| Name: %s | Kills: %d | Deaths: %d | Cash: %d",name, PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], PlayerInfo[playerid][Cash]);
SendClientMessage(playerid, COLOR_GREEN, string);
return 1;
}
Код:
C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\filterscripts\Login-Register.pwn(230) : warning 217: loose indentation C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\filterscripts\Login-Register.pwn(287) : error 017: undefined symbol "dcmd_stats" C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\filterscripts\Login-Register.pwn(289) : error 017: undefined symbol "dcmd_stats" C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\filterscripts\Login-Register.pwn(290) : warning 217: loose indentation C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\filterscripts\Login-Register.pwn(292) : error 001: expected token: ";", but found "new" C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\filterscripts\Login-Register.pwn(293) : warning 219: local variable "Cash" shadows a variable at a preceding level C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\filterscripts\Login-Register.pwn(294) : error 033: array must be indexed (variable "name") C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\filterscripts\Login-Register.pwn(296) : error 022: must be lvalue (non-constant) C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\filterscripts\Login-Register.pwn(293) : warning 203: symbol is never used: "Cash" C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\filterscripts\Login-Register.pwn(293 -- 301) : warning 225: unreachable code C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\filterscripts\Login-Register.pwn(293 -- 301) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
--------------------------------------------------
pawn Код:
// I got this on the top of the script to define "dcmd":
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
//This is my PlayerInfo:
enum PlayerData
{
Cash,
AdminLevel,
Name[MAX_PLAYER_NAME],
IP[16],
Registered,
Password,
LoggedIn,
Autologin,
Kills,
Deaths
};
new PlayerInfo[MAX_PLAYERS][PlayerData];
also, please dont be harsh, im new scripter and REALLY new to dcmd...
my english is bad too.
Thank you if you can help