DCMD help
#1

Ok... so this is my command(s):
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) {
    dcmd(stats,5,cmdtext);
    return 0;
}

   
dcmd_stats(playerid,params[])
{
    new string[128];
    new name[MAX_PLAYER_NAME];
    PlayerInfo[playerid][Cash] = GetPlayerMoney(playerid);
    GetPlayerName(playerid, name, sizeof(name));
    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;
}
if (strcmp("/factions", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid,0x00FF00AA,"{66FF66}|FACTIONS|{00FF00} 0)Civ 1)LSPD | 2)Army 3)EMS 4)Swat | 5)SS | 6) Gov | 7)Hit");
    return 1;
}
return 1;
}
I dont understand DCMD that well, as in the errors i get:
These are the errors:
Код:
C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\gamemodes\KTS.pwn(343) : error 017: undefined symbol "params"
C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\gamemodes\KTS.pwn(298) : warning 217: loose indentation
C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\gamemodes\KTS.pwn(343) : warning 203: symbol is never used: "params"
C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\gamemodes\KTS.pwn(343 -- 353) : error 010: invalid function or declaration
C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\gamemodes\KTS.pwn(343 -- 356) : error 010: invalid function or declaration
C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\gamemodes\KTS.pwn(343 -- 358) : error 010: invalid function or declaration
C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\gamemodes\KTS.pwn(343 -- 358) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Also, ignore the loose indention part, it still works with that.
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(stats, 5, cmdtext);
   
    if(strcmp("/factions", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, 0x00FF00AA, "{66FF66}|FACTIONS|{00FF00} 0)Civ 1)LSPD | 2)Army 3)EMS 4)Swat | 5)SS | 6) Gov | 7)Hit");
        return 1;
    }
    return 0;
}


dcmd_stats(playerid,params[])
{
    #pragma unused params
    new string[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "|Account| Name: %s | Kills: %d | Deaths: %d | Cash: %d", name, PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], GetPlayerMoney(playerid));
    SendClientMessage(playerid, COLOR_GREEN, string);
    return 1;
}
Reply
#3

Quote:
Originally Posted by CyberGhost
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(stats, 5, cmdtext);
   
    if(strcmp("/factions", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, 0x00FF00AA, "{66FF66}|FACTIONS|{00FF00} 0)Civ 1)LSPD | 2)Army 3)EMS 4)Swat | 5)SS | 6) Gov | 7)Hit");
        return 1;
    }
    return 0;
}


dcmd_stats(playerid,params[])
{
    #pragma unused params
    new string[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "|Account| Name: %s | Kills: %d | Deaths: %d | Cash: %d", name, PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], GetPlayerMoney(playerid));
    SendClientMessage(playerid, COLOR_GREEN, string);
    return 1;
}
Thanks, worked
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)