Error on playerid,
#1

Anyone who can fix this errors ?

Code:
C:\Users\Windows7\Desktop\Microsoft Corporation ©\Irish Verse\gamemodes\PRP-2.pwn(71855) : error 017: undefined symbol "playerid"
C:\Users\Windows7\Desktop\Microsoft Corporation ©\Irish Verse\gamemodes\PRP-2.pwn(71857) : error 017: undefined symbol "playerid"
C:\Users\Windows7\Desktop\Microsoft Corporation ©\Irish Verse\gamemodes\PRP-2.pwn(71859) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
That lines..

Code:
Kick(playerid);
				new playername[MAX_PLAYER_NAME];
				GetPlayerName(playerid, playername, sizeof(playername));
				new rapid[128];
				format(rapid, sizeof(rapid), "AdmCmd: %s has been kicked by AdminBot reason: Speed Hacking", playername[playerid]);
				SendClientMessageToAll(COLOR_LIGHTRED,rapid);
+1 Rep!
Reply
#2

In what function are you using it? The function must contain a playerid parameter.
Reply
#3

I just want to get its player name and send it to the whole server. Any fixes ?
Reply
#4

i think you defined a function or a stock where you dont this

Code:
public OnPlayerAimBot() [/pawn]but it should be
[pawn] public OnPlayerAimBot(playerid) 


use this stock for GetName(playerid);


stock GetName(playerid)
{
	new PlayerNamex[MAX_PLAYER_NAME];
	GetPlayerName(playerid, PlayerNamex, sizeof(PlayerNamex));
	return PlayerNamex;
}
if you dont have these then show the whoe public or stock code
Reply
#5

Here

Code:
if(GetPlayerState(i) == PLAYER_STATE_DRIVER && AdminDuty[i] != 1 && !IsAPlane(GetPlayerVehicleID(i))) {
  			new Float:fCurrentSpeed;
  			fCurrentSpeed = player_get_speed(i);
  			fVehSpeed[i] = fCurrentSpeed;
			if(fCurrentSpeed > 200) {
				new string[74 + MAX_PLAYER_NAME];
   				format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) may possibly be speed hacking (%.0f MPH).", GetPlayerNameEx(i), i, fCurrentSpeed);
   				ABroadCast(COLOR_YELLOW, string, 2);
   				SetPVarInt(i, "shW", GetPVarInt(i, "shW")+1);
				Kick(playerid);
				new playername[MAX_PLAYER_NAME];
				GetPlayerName(playerid, playername, sizeof(playername));
				new rapid[128];
				format(rapid, sizeof(rapid), "AdmCmd: %s has been kicked by AdminBot reason: Speed Hacking", playername[playerid]);
				SendClientMessageToAll(COLOR_LIGHTRED,rapid);
   				if(GetPVarInt(i, "shW") >= 3) {
	   				format(string, sizeof(string), "%s may possibly have speed hacked (speeds of %.0f MPH).", GetPlayerNameEx(i), fCurrentSpeed);
	   				AddAutomatedFlag(i, string);
   				}
			}
Reply
#6

That doesn't help.
The problem is you didn't define playerid, you should have a playerid parameter in the function or public you're trying to use playerid in.
Like you cannot use playerid in OnGameModeInit(), but you can in OnPlayerConnect(playerid)
Reply
#7

same as you did above

Code:
GetPlayerNameEx(i)
Reply
#8

Okay this is my code

Code:
if(GetPlayerState(i) == PLAYER_STATE_DRIVER && AdminDuty[i] != 1 && !IsAPlane(GetPlayerVehicleID(i))) {
                        new Float:fCurrentSpeed;
                        fCurrentSpeed = player_get_speed(i);
                        fVehSpeed[i] = fCurrentSpeed;
                        if(fCurrentSpeed > 200) {
                                new string[74 + MAX_PLAYER_NAME];
                                format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) may possibly be speed hacking (%.0f MPH).", GetPlayerNameEx(i), i, fCurrentSpeed);
                                ABroadCast(COLOR_YELLOW, string, 2);
                                SetPVarInt(i, "shW", GetPVarInt(i, "shW")+1);
                                Kick(playerid);
                                new playername[MAX_PLAYER_NAME];
                                GetPlayerName(playerid, playername, sizeof(playername));
                                new rapid[128];
                                format(rapid, sizeof(rapid), "AdmCmd: %s has been kicked by AdminBot reason: Speed Hacking", playername[playerid]);
                                SendClientMessageToAll(COLOR_LIGHTRED,rapid);
                                if(GetPVarInt(i, "shW") >= 3) {
                                        format(string, sizeof(string), "%s may possibly have speed hacked (speeds of %.0f MPH).", GetPlayerNameEx(i), fCurrentSpeed);
                                        AddAutomatedFlag(i, string);
                                }
                        }
                }
I want it to for example the cheater uses his cheat speed hacking, then his name will be shouted to the whole server like this msg "AdmCmd: %s has been kicked by AdminBot reason: Speed Hacking" then thats .
Reply
#9

Then use SetTimerEx when the player connects, or SetTimer in OnGameModeInit and loop through all players.
Reply
#10

oh you are looping through all players then use i insteed of playerid

Code:
if(GetPlayerState(i) == PLAYER_STATE_DRIVER && AdminDuty[i] != 1 && !IsAPlane(GetPlayerVehicleID(i))) 
{
    new Float:fCurrentSpeed;
    fCurrentSpeed = player_get_speed(i);
    fVehSpeed[i] = fCurrentSpeed;
	if(fCurrentSpeed > 200) {
	new string[74 + MAX_PLAYER_NAME];
	format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) may possibly be speed hacking (%.0f MPH).", GetPlayerNameEx(i), i, fCurrentSpeed);
	ABroadCast(COLOR_YELLOW, string, 2);
	SetPVarInt(i, "shW", GetPVarInt(i, "shW")+1);
	Kick(i);
	new playername[MAX_PLAYER_NAME];
	GetPlayerName(i, playername, sizeof(playername));
	new rapid[128];
	format(rapid, sizeof(rapid), "AdmCmd: %s has been kicked by AdminBot reason: Speed Hacking", playername[i]);
	SendClientMessageToAll(COLOR_LIGHTRED,rapid);
	if(GetPVarInt(i, "shW") >= 3) 
	{
		format(string, sizeof(string), "%s may possibly have speed hacked (speeds of %.0f MPH).", GetPlayerNameEx(i), fCurrentSpeed);
		AddAutomatedFlag(i, string);
	}
}
Reply
#11

+1 rep jeason
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)