i don't get what's wrong? -
pmk1 - 08.05.2010
hey guys, me again, im not that good with dcmd, and i get a problem with akill.
the error is:
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\PMKadminscript.pwn(342) : error 017: undefined symbol "GetPlayerId"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
yea i used the script from the wiki for akill:
Код:
dcmd_akill(playerid, params[])
{
if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[AKILL])
{
new string[100];
format(string, sizeof(string), "You must be Admin level %d to use that command!", gCommands[AKILL]);
return SendClientMessage(playerid, COLOUR_ORANGE, string);
}
else if(!strlen(params))
return SendClientMessage(playerid, COLOUR_ORANGE, "/akill [id/name]");
else
{
new id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
if(IsPlayerConnected(id) && id != playerid)
{
SetPlayerHealth(id, 0.0);
new string[150];
format(string, sizeof(string), "You have been admin-killed by an admin");
SendClientMessage(id, COLOUR_ORANGE, string);
format(string, sizeof(string), "You have successfully admin-killed player \'%s\'.", gPlayerInfo[id][PLAYER_NAME]);
return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
}
else
return SendClientMessage(playerid, COLOUR_ORANGE, "You can not Akill yourself or a disconnected player.");
}
}
the problem is at new id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
i tried defining it but i just got more errors.
can someone help me out? thanks and sorry for my noobish xd
Re: i don't get what's wrong? -
[NYRP]Mike. - 08.05.2010
GetPlayerID isn't an actual function in a_samp.inc so you'll have to create it.
Secondly, why don't you just use params instead as GetPlayerID(params) is exactly the same as params.
Re: i don't get what's wrong? -
pmk1 - 08.05.2010
ok but how? lol i really suck at it it's my first code with dcmd
Re: i don't get what's wrong? -
pmk1 - 13.05.2010
bummmmmmmmmmmmmmmp
Re: i don't get what's wrong? -
juice.j - 13.05.2010
Код:
dcmd_akill(playerid, params[])
{
if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[AKILL])
{
new string[100];
format(string, sizeof(string), "You must be Admin level %d to use that command!", gCommands[AKILL]);
SendClientMessage(playerid, COLOUR_ORANGE, string);
return 1:
}
new user;
if(sscanf(params,"u",user))
{
SendClientMessage(playerid, COLOUR_ORANGE, "/akill [id/name]");
return 1;
}
if(IsPlayerConnected(user) && user != playerid)
{
SetPlayerHealth(user, 0.0);
new string[150];
format(string, sizeof(string), "You have been admin-killed by an admin");
SendClientMessage(user, COLOUR_ORANGE, string);
format(string, sizeof(string), "You have successfully admin-killed player \'%s\'.", gPlayerInfo[user][PLAYER_NAME]);
SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
}
else
SendClientMessage(playerid, COLOUR_ORANGE, "You can not Akill yourself or a disconnected player.");
return 1;
}
// As quickly written down, not tested for any typos. Adjust it as you please.
Re: i don't get what's wrong? -
pmk1 - 18.05.2010
thanks

but sscanf is not defined, how can i do so? i didn't use it yet. thanks