if ((oldkeys & KEY_FIRE) && (newkeys & KEY_CROUCH)&& GetPlayerWeapon(playerid)==24) { SetPlayerHealth(playerid,0); GameTextForPlayer(playerid, "~r~ C Bug not allowed.", 3000, 1); }
new CBugWarnings[MAX_PLAYERS];
CBugWarnings[playerid] = 0;
if ((oldkeys & KEY_FIRE) && (newkeys & KEY_CROUCH)&& GetPlayerWeapon(playerid)==24)
{
if(CBugWarnings[playerid] >= 5)
{
SendClientMessage(playerid, -1, "You've been killed for Cbugging.");
CBugWarnings[playerid] = 0;
SetPlayerHealth(playerid,0);
GameTextForPlayer(playerid, "~r~ C Bug not allowed.", 3000, 1);
return 1;
}
new string[129];
CBugWarnings[playerid] += 1;
format(string, sizeof(string), "[WARNING] C-Bugging is not allowed! (%d/5)",CBugWarnings[playerid]);
SendClientMessage(playerid, -1, string);
}
CBugWarnings[playerid] ++; // Increases an array by 1, we'll call it "CBugWarnings"
format(string, sizeof(string), "Do not C-Bug [%i/5]", CBugWarnings[playerid]); // Formats an array we'll call "string", and sends it with SendClientMessage
SendClientMessage(playerid, -1, string);
if(CBugWarnings[playerid] == 5) // If the warnings are 5
{
CBugWarnings[playerid] = 0; // Reset CBugWarnings
SetPlayerHealth(playerid, 0); // And kill the player
}
#include <a_samp> #define RED 0xFF0000AA forward OnPlayerMakeCBug(playerid); public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { CBugWarnings[playerid] ++; // Increases the Warning array by 1 format(string, sizeof(string), "Do not C-Bug [%i/5]", CBugWarnings[playerid]); // Formats the string, and sends it with SendClientMessage SendClientMessage(playerid, -1, string); if(CBugWarnings[playerid] == 5) // If the warnings are 5 { CBugWarnings[playerid] = 0; // Reset CBugWarnings SetPlayerHealth(playerid, 0); // And kill the player return 1; } |
pwn(8) : error 017: undefined symbol "CBugWarnings" pwn(8) : warning 215: expression has no effect pwn(8) : error 001: expected token: ";", but found "]" pwn(8) : error 029: invalid expression, assumed zero pwn(8) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
new CBugWarnings[MAX_PLAYERS];
.pwn(16) : warning 217: loose indentation .pwn(17) : warning 217: loose indentation .pwn(20) : error 030: compound statement not closed at the end of file (started at line 10) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. |
format(string, sizeof(string), "Do not C-Bug [%i/5]", CBugWarnings[playerid]); // Formats the string, and sends it with SendClientMessage |
new string [MAX_PLAYERS];
#include <a_samp> #define RED 0xFF0000AA forward OnPlayerMakeCBug(playerid); new CBugWarnings[MAX_PLAYERS]; new string[MAX_PLAYERS]; public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { CBugWarnings[playerid] ++; // Increases the Warning array by 1 format(string, sizeof(string), "Do not C-Bug [%i/5]", CBugWarnings[playerid]); // Formats the string, and sends it with SendClientMessage SendClientMessage(playerid, -1, string); if(CBugWarnings[playerid] == 5) // If the warnings are 5 { CBugWarnings[playerid] = 0; // Reset CBugWarnings SetPlayerHealth(playerid, 0); // And kill the player return 1; }