COMMAND:pay(playerid, params[]) { new targetid, value; if (sscanf(params, "ui", targetid, value)) SendClientMessage (playerid, 0xBDB76BAA, "ERROR: /pay [targetid] [value]"); else if (value > GetPlayerMoney(playerid)) SendClientMessage (playerid, 0xBDB76BAA, "You can't afford that much"); else if (targetid == INVALID_PLAYER_ID) SendClientMessage (playerid, 0xBDB76BAA, "Player Not Found"); else { GivePlayerMoney (playerid, 0- value); GivePlayerMoney (targetid, value); SendClientMessage (playerid, 0xBDB76BAA, "You have sent %i to %u"); SendClientMessage (playerid, 0xBDB76BAA, "You received %i from %u"); } return 1; }
public OnPlayerCommandText(playerid, cmdtext[]) { dcmd(heal, 4, cmdtext); return 0; } dcmd_heal(playerid, params[]) { new id; if (sscanf(params, "u", id)) SendClientMessage (playerid, 0x33CCFFAA, "Usage: /heal [playerid]"); if (IsPlayerAdmin(playerid)) SendClientMessage (playerid, 0x33CCFFAA, "You have no access to this command"); else if (id == INVALID_PLAYER_ID) SendClientMessage (playerid, 0x33CCFFAA, "Player not found"); else { SetPlayerHealth (id, 100.0); SendClientMessage (id, 0x33CCFFAA, "You have been healed"); SendClientMessage (playerid, 0x33CCFFAA, "Player healed"); } return 1; } { dcmd(pay, 3, cmdtext); return 0; } dcmd_pay (playerid, params[]) { new targetid; if (sscanf(params, "ui", targetid, value)) SendClientMessage (playerid, 0x33CCFFAA, "Usage: /pay [playerid] [value]"); else if (targetid = INVALID_PLAYER_ID) SendClientMessage (playerid, 0x33CCFFAA, "Player not found"); else if (value > GetPlayerMoney(playerid)) SendClientMessage (playerid, 0x33CCFFAA, "You can't afford that much"); else { GivePlayerMoney (targetid, value); GivePlayerMoney (playerid, 0- value); SendClientMessage (targetid, 0x33CCFFAA, "%u sent you %i"); SendClientMessage (playerid, 0x33CCFFAA, "You succesfully sent %i to %u); } return 1; }
C:\Program Files\GTA San Andreas\server\filterscripts\dcmdtest.pwn(129) : error 055: start of function body without function header C:\Program Files\GTA San Andreas\server\filterscripts\dcmdtest.pwn(130) : error 010: invalid function or declaration C:\Program Files\GTA San Andreas\server\filterscripts\dcmdtest.pwn(131) : error 010: invalid function or declaration C:\Program Files\GTA San Andreas\server\filterscripts\dcmdtest.pwn(283) : warning 203: symbol is never used: "dcmd_pay" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
{ dcmd(pay, 3, cmdtext); return 0; } |
public OnPlayerCommandText(playerid, cmdtext[]) { dcmd(heal, 4, cmdtext); return 0; } dcmd_heal(playerid, params[]) { new id; if (sscanf(params, "u", id)) SendClientMessage (playerid, 0x33CCFFAA, "Usage: /heal [playerid]"); if (IsPlayerAdmin(playerid)) SendClientMessage (playerid, 0x33CCFFAA, "You have no access to this command"); else if (id == INVALID_PLAYER_ID) SendClientMessage (playerid, 0x33CCFFAA, "Player not found"); else { SetPlayerHealth (id, 100.0); SendClientMessage (id, 0x33CCFFAA, "You have been healed"); SendClientMessage (playerid, 0x33CCFFAA, "Player healed"); } return 1; } { dcmd(pay, 3, cmdtext); return 0; } dcmd_pay (playerid, params[]) { new targetid; if (sscanf(params, "ui", targetid, value)) SendClientMessage (playerid, 0x33CCFFAA, "Usage: /pay [playerid] [value]"); else if (targetid = INVALID_PLAYER_ID) SendClientMessage (playerid, 0x33CCFFAA, "Player not found"); else if (value > GetPlayerMoney(playerid)) SendClientMessage (playerid, 0x33CCFFAA, "You can't afford that much"); else { GivePlayerMoney (targetid, value); GivePlayerMoney (playerid, 0- value); SendClientMessage (targetid, 0x33CCFFAA, "%u sent you %i"); SendClientMessage (playerid, 0x33CCFFAA, "You succesfully sent %i to %u); } return 1; }
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(heal, 4, cmdtext);
dcmd(pay, 3, cmdtext);
return 0;
}
dcmd_heal(playerid, params[])
{
new
id;
if (sscanf(params, "u", id)) SendClientMessage (playerid, 0x33CCFFAA, "Usage: /heal [playerid]");
if (IsPlayerAdmin(playerid)) SendClientMessage (playerid, 0x33CCFFAA, "You have no access to this command");
else if (id == INVALID_PLAYER_ID) SendClientMessage (playerid, 0x33CCFFAA, "Player not found");
else
{
SetPlayerHealth (id, 100.0);
SendClientMessage (id, 0x33CCFFAA, "You have been healed");
SendClientMessage (playerid, 0x33CCFFAA, "Player healed");
}
return 1;
}
dcmd_pay (playerid, params[])
{
new targetid;
if (sscanf(params, "ui", targetid, value)) SendClientMessage (playerid, 0x33CCFFAA, "Usage: /pay [playerid] [value]");
else if (targetid = INVALID_PLAYER_ID) SendClientMessage (playerid, 0x33CCFFAA, "Player not found");
else if (value > GetPlayerMoney(playerid)) SendClientMessage (playerid, 0x33CCFFAA, "You can't afford that much");
else
{
GivePlayerMoney (targetid, value);
GivePlayerMoney (playerid, 0- value);
SendClientMessage (targetid, 0x33CCFFAA, "%u sent you %i");
SendClientMessage (playerid, 0x33CCFFAA, "You succesfully sent %i to %u);
}
return 1;
}
C:\Program Files\GTA San Andreas\server\filterscripts\dcmdtest.pwn(110) : warning 217: loose indentation
C:\Program Files\GTA San Andreas\server\filterscripts\dcmdtest.pwn(111) : warning 217: loose indentation
C:\Program Files\GTA San Andreas\server\filterscripts\dcmdtest.pwn(133) : error 017: undefined symbol "value"
C:\Program Files\GTA San Andreas\server\filterscripts\dcmdtest.pwn(134) : warning 211: possibly unintended assignment
C:\Program Files\GTA San Andreas\server\filterscripts\dcmdtest.pwn(135) : error 017: undefined symbol "value"
C:\Program Files\GTA San Andreas\server\filterscripts\dcmdtest.pwn(138) : error 017: undefined symbol "value"
C:\Program Files\GTA San Andreas\server\filterscripts\dcmdtest.pwn(139) : error 017: undefined symbol "value"
C:\Program Files\GTA San Andreas\server\filterscripts\dcmdtest.pwn(141) : error 037: invalid string (possibly non-terminated string)
C:\Program Files\GTA San Andreas\server\filterscripts\dcmdtest.pwn(141) : error 017: undefined symbol "You"
C:\Program Files\GTA San Andreas\server\filterscripts\dcmdtest.pwn(141) : error 017: undefined symbol "succesfully"
C:\Program Files\GTA San Andreas\server\filterscripts\dcmdtest.pwn(141) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
8 Errors.
COMMAND:heal(playerid, params[])
{
new
id;
if (sscanf(params, "u", id)) SendClientMessage (playerid, 0x33CCFFAA, "Usage: /heal [playerid]");
if (IsPlayerAdmin(playerid)) SendClientMessage (playerid, 0x33CCFFAA, "You have no access to this command");
else if (id == INVALID_PLAYER_ID) SendClientMessage (playerid, 0x33CCFFAA, "Player not found");
else
{
SetPlayerHealth (id, 100.0);
SendClientMessage (id, 0x33CCFFAA, "You have been healed");
SendClientMessage (playerid, 0x33CCFFAA, "Player healed");
}
return 1;
}
COMMAND:pay(playerid, params[])
{
new targetid, value;
if (sscanf(params, "ui", targetid, value)) SendClientMessage (playerid, 0x33CCFFAA, "Usage: /pay [playerid] [value]");
else if (targetid == INVALID_PLAYER_ID) SendClientMessage (playerid, 0x33CCFFAA, "Player not found");
else if (value > GetPlayerMoney(playerid)) SendClientMessage (playerid, 0x33CCFFAA, "You can't afford that much");
else
{
GivePlayerMoney (targetid, value);
GivePlayerMoney (playerid, 0- value);
SendClientMessage (targetid, 0x33CCFFAA, "%u sent you %i");
SendClientMessage (playerid, 0x33CCFFAA, "You succesfully sent %i to %u");
}
return 1;
}
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
CMD:me(playerid, params[])
{
new str[128], pName[MAX_PLAYER_NAME];
if(!strlen(params[0]) || strlen(params[0] > 75)
return SendClientMessage(playerid, 0xFF0000AA, "The length must be above 0 and below 76!");
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(str, 128, "* %s %s", pName, params[0]);
SendClientMessageToAll(0x00FF00AA, str);
return 1;
}