[HELP] Warnings - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] Warnings (
/showthread.php?tid=289778)
[HELP] Warnings -
DaRkAnGeL[NBK] - 12.10.2011
Hey currently creating some of my anti cheat but i get really annoying warnings:
pawn Код:
new pMoney[MAX_PLAYERS];
new ForbiddenWeapons[][] = {
38, //Minigun
35, //RPG
36 //Heatseeking RPG
};
pawn Код:
public OnPlayerUpdate(playerid)
{
new pName[MAX_PLAYER_NAME], string[128];
if(GetPlayerMoney(playerid) > pMoney[playerid])
{
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "[SERVER]: %s has been banned, Reason: Money Hack", pName);
SendClientMessageToAll(COLOR_RED, string);
BanEx(playerid, "Money Hack");
}
new w = 0;
while(w < (sizeof(ForbiddenWeapons))){
if(GetPlayerWeapon(playerid) == w){
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "[SERVER]: %s has been banned, Reason: Weapon Hack", pName);
SendClientMessageToAll(COLOR_RED, string);
BanEx(playerid, "Weapon Hacks");
}
return 1;
}
}
Код:
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\gamemodes\diftV1.pwn(98) : warning 209: function "OnPlayerUpdate" should return a value
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\gamemodes\diftV1.pwn(1306) : warning 203: symbol is never used: "ForbiddenWeapons"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Warnings.
i mean i know the wont affect anything but i like to have my gamemodes perfectly compiled so could anyone help please?
Re: [HELP] Warnings -
grand.Theft.Otto - 12.10.2011
pawn Код:
warning 209: function "OnPlayerUpdate" should return a value
// ^ as straight forward as it says, add return 1; under onplayerupdate
warning 203: symbol is never used: "ForbiddenWeapons"
// ^ means ForbiddenWeapons is created, but never used
AW: [HELP] Warnings -
Drebin - 12.10.2011
pawn Код:
public OnPlayerUpdate(playerid)
{
new pName[MAX_PLAYER_NAME], string[128];
if(GetPlayerMoney(playerid) > pMoney[playerid])
{
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "[SERVER]: %s has been banned, Reason: Money Hack", pName);
SendClientMessageToAll(COLOR_RED, string);
BanEx(playerid, "Money Hack");
return 1;
}
new w = 0;
while(w < (sizeof(ForbiddenWeapons)))
{
if(GetPlayerWeapon(playerid) == w)
{
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "[SERVER]: %s has been banned, Reason: Weapon Hack", pName);
SendClientMessageToAll(COLOR_RED, string);
BanEx(playerid, "Weapon Hacks");
return 1;
}
}
return 0;
}
pawn Код:
symbol is never used: "ForbiddenWeapons"
simply means that you defined "ForbiddenWeapons" but never used it.
Re: [HELP] Warnings -
DaRkAnGeL[NBK] - 12.10.2011
pawn Код:
public OnPlayerUpdate(playerid)
{
new pName[MAX_PLAYER_NAME], string[128];
if(GetPlayerMoney(playerid) > pMoney[playerid])
{
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "[SERVER]: %s has been banned, Reason: Money Hack", pName);
SendClientMessageToAll(COLOR_RED, string);
BanEx(playerid, "Money Hack");
return 1;
}
new w = 0;
while(w < (sizeof(ForbiddenWeapons))){
if(GetPlayerWeapon(playerid) == w)
{
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "[SERVER]: %s has been banned, Reason: Weapon Hack", pName);
SendClientMessageToAll(COLOR_RED, string);
BanEx(playerid, "Weapon Hacks");
return 1;
}
return 1;
}
}
Still the same warnings but when i dont include the return 1; i get non XD
AW: [HELP] Warnings -
Drebin - 12.10.2011
Copy the one I made and try this.
Re: [HELP] Warnings -
Tigerkiller - 12.10.2011
put return 1; over the last braked ( } )