public OnPlayerCommandText(playerid, cmdtext[])
{
COMMAND:freeze(playerid, params[])
{
new otherplayerid;
if(sscanf(params, "d", otherplayerid)) return SendClientMessage(playerid, COLOUR_LIGHTBLUE, "Use /freeze [playerid/name]");
else if(!IsPlayerConnected(otherplayerid)) return SendClientMessage(playerid, COLOUR_GREEN, "This player is not connected");
else
{
SendClientMessage(otherplayerid,COLOUR_GREEN,"The Admin %d killed you!");
TogglePlayerControllable(otherplayerid, 0);
}
return 1;}
return 0;
}
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(20) : error 017: undefined symbol "freeze"
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(23) : error 017: undefined symbol "sscanf"
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(30) : warning 217: loose indentation
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(31) : warning 225: unreachable code
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(20) : warning 203: symbol is never used: "COMMAND"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.
SendClientMessage(otherplayerid,COLOUR_GREEN,"The Admin %d killed you!");
//Put this under "OnPlayerCommandText if(strcmp(cmd, "/freeze", true) == 0) // Freezes the player. Prevents him from moving { new reason[128]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, ORANGE, "USAGE: /freeze [playername/id] [reason]"); SendClientMessage(playerid, ORANGE, "FUNCTION: Will freeze the specified player."); return 1; } new giveplayerid = ReturnUser(tmp); if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername)); GetPlayerName(playerid, sendername, sizeof(sendername)); reason = bigstrtok(cmdtext, idx); if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /freeze [playername/id] [reason]"); format(string, sizeof(string), " Administrator %s froze %s. [Reason: %s ] ", sendername, giveplayername, reason); SendClientMessageToAll(red, string); TogglePlayerControllable(giveplayerid, false); } else if(giveplayerid == INVALID_PLAYER_ID) { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, RED, string); } return 1; }
stock strtok(const string[], &idx) { new length = strlen(string); while ((idx < length) && (string[idx] <= ' ')) { idx++; } new offset = idx; new result[128]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = string[idx]; idx++; } result[idx - offset] = EOS; return result; }
ReturnUser(text[], playerid = INVALID_PLAYER_ID) { new pos = 0; while (text[pos] < 0x21) { if (text[pos] == 0) return INVALID_PLAYER_ID; pos++; } new userid = INVALID_PLAYER_ID; if (IsNumeric(text[pos])) { userid = strval(text[pos]); if (userid >=0 && userid < MAX_PLAYERS) { if(!IsPlayerConnected(userid)) userid = INVALID_PLAYER_ID; else return userid; } } new len = strlen(text[pos]); new count = 0; new pname[MAX_PLAYER_NAME]; for (new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { GetPlayerName(i, pname, sizeof (pname)); if (strcmp(pname, text[pos], true, len) == 0) { if (len == strlen(pname)) return i; else { count++; userid = i; } } } } if (count != 1) { if (playerid != INVALID_PLAYER_ID) { if (count) SendClientMessage(playerid, YELLOW, "There are multiple users, enter full playername."); else SendClientMessage(playerid, RED, "Playername not found."); } userid = INVALID_PLAYER_ID; } return userid; }
if(strcmp(cmd, "/unfreeze", true) == 0) // Unfreezes the player { // if IsPlayerAdmin(playerid)) //{ tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, ORANGE, "USAGE: /unfreeze [playername/id]"); SendClientMessage(playerid, ORANGE, "FUNCTION: Will unfreeze the specified player."); return 1; } new giveplayerid = ReturnUser(tmp); if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), " Administrator %s has unfrozen %s ", sendername,giveplayername); MessageToAdmins(blue, string); TogglePlayerControllable(giveplayerid, true); } else if(giveplayerid == INVALID_PLAYER_ID) { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, RED, string); } return 1; }
#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#define COLOUR_GREEN 0x33AA33AA
#define COLOUR_RED 0xAA3333AA
#define COLOUR_YELLOW 0xFFFF00AA
#define COLOUR_LIGHTBLUE 0x33CCFFAA
#define COLOUR_ORANGE 0xFF9900AA
public OnFilterScriptInit()
{
print("\n****************************************");
print("* AdminCmds *");
print("****************************************\n");
return 1;
}
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/freeze", true) == 0) // Freezes the player. Prevents him from moving
{
new reason[128];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /freeze [playername/id] [reason]");
SendClientMessage(playerid, COLOUR_ORANGE, "FUNCTION: Will freeze the specified player.");
return 1;
}
new giveplayerid = ReturnUser(tmp);
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
GetPlayerName(playerid, sendername, sizeof(sendername));
reason = bigstrtok(cmdtext, idx);
if(!strlen(reason)) return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /freeze [playername/id] [reason]");
format(string, sizeof(string), " Administrator %s froze %s. [Reason: %s ] ", sendername, giveplayername, reason);
SendClientMessageToAll(red, string);
TogglePlayerControllable(giveplayerid, false);
}
else if(giveplayerid == INVALID_PLAYER_ID)
{
format(string, sizeof(string), "%d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOUR_RED, string);
}
return 1;
}
return 0;
}
stock strtok(const string[], &idx)
{
new length = strlen(string);
while ((idx < length) && (string[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = string[idx];
idx++;
}
result[idx - offset] = EOS;
return result;
}
ReturnUser(text[], playerid = INVALID_PLAYER_ID)
{
new pos = 0;
while (text[pos] < 0x21)
{
if (text[pos] == 0) return INVALID_PLAYER_ID;
pos++;
}
new userid = INVALID_PLAYER_ID;
if (IsNumeric(text[pos]))
{
userid = strval(text[pos]);
if (userid >=0 && userid < MAX_PLAYERS)
{
if(!IsPlayerConnected(userid))
userid = INVALID_PLAYER_ID;
else return userid;
}
}
new len = strlen(text[pos]);
new count = 0;
new pname[MAX_PLAYER_NAME];
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
GetPlayerName(i, pname, sizeof (pname));
if (strcmp(pname, text[pos], true, len) == 0)
{
if (len == strlen(pname)) return i;
else
{
count++;
userid = i;
}
}
}
}
if (count != 1)
{
if (playerid != INVALID_PLAYER_ID)
{
if (count) SendClientMessage(playerid, YELLOW, "There are multiple users, enter full playername.");
else SendClientMessage(playerid, RED, "Playername not found.");
}
userid = INVALID_PLAYER_ID;
}
return userid;
}
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(20) : error 017: undefined symbol "cmd"
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(25) : warning 217: loose indentation
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(25) : error 017: undefined symbol "tmp"
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(25) : error 017: undefined symbol "idx"
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(26) : error 017: undefined symbol "tmp"
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(33) : error 017: undefined symbol "tmp"
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(36) : error 017: undefined symbol "giveplayername"
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(36) : error 017: undefined symbol "giveplayername"
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(36) : error 029: invalid expression, assumed zero
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(36) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
9 Errors.
#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#define COLOUR_GREEN 0x33AA33AA
#define COLOUR_RED 0xAA3333AA
#define COLOUR_YELLOW 0xFFFF00AA
#define COLOUR_LIGHTBLUE 0x33CCFFAA
#define COLOUR_ORANGE 0xFF9900AA
public OnFilterScriptInit()
{
print("\n****************************************");
print("* AdminCmds *");
print("****************************************\n");
return 1;
}
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
new giveplayername[MAX_PLAYER_NAME], giveplayerid, tmp[256], cmd[256], idx;
if(strcmp(cmd, "/freeze", true) == 0) // Freezes the player. Prevents him from moving
{
new reason[128];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /freeze [playername/id] [reason]");
SendClientMessage(playerid, COLOUR_ORANGE, "FUNCTION: Will freeze the specified player.");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
GetPlayerName(playerid, sendername, sizeof(sendername));
reason = bigstrtok(cmdtext, idx);
if(!strlen(reason)) return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /freeze [playername/id] [reason]");
format(string, sizeof(string), " Administrator %s froze %s. [Reason: %s ] ", sendername, giveplayername, reason);
SendClientMessageToAll(red, string);
TogglePlayerControllable(giveplayerid, false);
}
else if(giveplayerid == INVALID_PLAYER_ID)
{
format(string, sizeof(string), "%d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOUR_RED, string);
}
return 1;
}
return 0;
}
stock strtok(const string[], &idx)
{
new length = strlen(string);
while ((idx < length) && (string[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = string[idx];
idx++;
}
result[idx - offset] = EOS;
return result;
}
ReturnUser(text[], playerid = INVALID_PLAYER_ID)
{
new pos = 0;
while (text[pos] < 0x21)
{
if (text[pos] == 0) return INVALID_PLAYER_ID;
pos++;
}
new userid = INVALID_PLAYER_ID;
if (IsNumeric(text[pos]))
{
userid = strval(text[pos]);
if (userid >=0 && userid < MAX_PLAYERS)
{
if(!IsPlayerConnected(userid))
userid = INVALID_PLAYER_ID;
else return userid;
}
}
new len = strlen(text[pos]);
new count = 0;
new pname[MAX_PLAYER_NAME];
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
GetPlayerName(i, pname, sizeof (pname));
if (strcmp(pname, text[pos], true, len) == 0)
{
if (len == strlen(pname)) return i;
else
{
count++;
userid = i;
}
}
}
}
if (count != 1)
{
if (playerid != INVALID_PLAYER_ID)
{
if (count) SendClientMessage(playerid, YELLOW, "There are multiple users, enter full playername.");
else SendClientMessage(playerid, RED, "Playername not found.");
}
userid = INVALID_PLAYER_ID;
}
return userid;
}
lol, UNBELIVEABLE........ MAKE a var.
pawn Код:
|
#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#define COLOUR_GREEN 0x33AA33AA
#define COLOUR_RED 0xAA3333AA
#define COLOUR_YELLOW 0xFFFF00AA
#define COLOUR_LIGHTBLUE 0x33CCFFAA
#define COLOUR_ORANGE 0xFF9900AA
public OnFilterScriptInit()
{
print("\n****************************************");
print("* AdminCmds *");
print("****************************************\n");
return 1;
}
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
new giveplayername[MAX_PLAYER_NAME], giveplayerid, tmp[256], cmd[256], idx;
if(strcmp(cmd, "/freeze", true) == 0) // Freezes the player. Prevents him from moving
{
new reason[128];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /freeze [playername/id] [reason]");
SendClientMessage(playerid, COLOUR_ORANGE, "FUNCTION: Will freeze the specified player.");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
GetPlayerName(playerid, sendername, sizeof(sendername));
reason = bigstrtok(cmdtext, idx);
if(!strlen(reason)) return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /freeze [playername/id] [reason]");
format(string, sizeof(string), " Administrator %s froze %s. [Reason: %s ] ", sendername, giveplayername, reason);
SendClientMessageToAll(red, string);
TogglePlayerControllable(giveplayerid, false);
}
else if(giveplayerid == INVALID_PLAYER_ID)
{
format(string, sizeof(string), "%d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOUR_RED, string);
}
return 1;
}
return 0;
}
stock strtok(const string[], &idx)
{
new length = strlen(string);
while ((idx < length) && (string[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = string[idx];
idx++;
}
result[idx - offset] = EOS;
return result;
}
ReturnUser(text[], playerid = INVALID_PLAYER_ID)
{
new pos = 0;
while (text[pos] < 0x21)
{
if (text[pos] == 0) return INVALID_PLAYER_ID;
pos++;
}
new userid = INVALID_PLAYER_ID;
if (IsNumeric(text[pos]))
{
userid = strval(text[pos]);
if (userid >=0 && userid < MAX_PLAYERS)
{
if(!IsPlayerConnected(userid))
userid = INVALID_PLAYER_ID;
else return userid;
}
}
new len = strlen(text[pos]);
new count = 0;
new pname[MAX_PLAYER_NAME];
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
GetPlayerName(i, pname, sizeof (pname));
if (strcmp(pname, text[pos], true, len) == 0)
{
if (len == strlen(pname)) return i;
else
{
count++;
userid = i;
}
}
}
}
if (count != 1)
{
if (playerid != INVALID_PLAYER_ID)
{
if (count) SendClientMessage(playerid, YELLOW, "There are multiple users, enter full playername.");
else SendClientMessage(playerid, RED, "Playername not found.");
}
userid = INVALID_PLAYER_ID;
}
return userid;
}
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(13) : warning 217: loose indentation
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(15) : warning 217: loose indentation
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(26) : warning 217: loose indentation
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(38) : error 017: undefined symbol "sendername"
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(38) : error 017: undefined symbol "sendername"
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(38) : error 029: invalid expression, assumed zero
D:\gta san andreas online\Godfucker\filterscripts\AdminCmds.pwn(38) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#define COLOUR_GREEN 0x33AA33AA
#define COLOUR_RED 0xAA3333AA
#define COLOUR_YELLOW 0xFFFF00AA
#define COLOUR_LIGHTBLUE 0x33CCFFAA
#define COLOUR_ORANGE 0xFF9900AA
public OnFilterScriptInit()
{
print("\n****************************************");
print("* AdminCmds *");
print("****************************************\n");
return 1;
}
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
new giveplayername[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME], giveplayerid, tmp[256], cmd[256], idx;
if(strcmp(cmd, "/freeze", true) == 0) // Freezes the player. Prevents him from moving
{
new reason[128];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /freeze [playername/id] [reason]");
SendClientMessage(playerid, COLOUR_ORANGE, "FUNCTION: Will freeze the specified player.");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
GetPlayerName(playerid, sendername, sizeof(sendername));
reason = bigstrtok(cmdtext, idx);
if(!strlen(reason)) return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /freeze [playername/id] [reason]");
format(string, sizeof(string), " Administrator %s froze %s. [Reason: %s ] ", sendername, giveplayername, reason);
SendClientMessageToAll(red, string);
TogglePlayerControllable(giveplayerid, false);
}
else if(giveplayerid == INVALID_PLAYER_ID)
{
format(string, sizeof(string), "%d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOUR_RED, string);
}
return 1;
}
return 0;
}
stock strtok(const string[], &idx)
{
new length = strlen(string);
while ((idx < length) && (string[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = string[idx];
idx++;
}
result[idx - offset] = EOS;
return result;
}
ReturnUser(text[], playerid = INVALID_PLAYER_ID)
{
new pos = 0;
while (text[pos] < 0x21)
{
if (text[pos] == 0) return INVALID_PLAYER_ID;
pos++;
}
new userid = INVALID_PLAYER_ID;
if (IsNumeric(text[pos]))
{
userid = strval(text[pos]);
if (userid >=0 && userid < MAX_PLAYERS)
{
if(!IsPlayerConnected(userid))
userid = INVALID_PLAYER_ID;
else return userid;
}
}
new len = strlen(text[pos]);
new count = 0;
new pname[MAX_PLAYER_NAME];
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
GetPlayerName(i, pname, sizeof (pname));
if (strcmp(pname, text[pos], true, len) == 0)
{
if (len == strlen(pname)) return i;
else
{
count++;
userid = i;
}
}
}
}
if (count != 1)
{
if (playerid != INVALID_PLAYER_ID)
{
if (count) SendClientMessage(playerid, YELLOW, "There are multiple users, enter full playername.");
else SendClientMessage(playerid, RED, "Playername not found.");
}
userid = INVALID_PLAYER_ID;
}
return userid;
}