017: undefined Symbol Helpppp -
Robber7 - 17.04.2014
C:\Users\Qaziii\Desktop\others\LOL.pwn(17) : error 017: undefined symbol "dcmd_fakechat"
C:\Users\Qaziii\Desktop\others\LOL.pwn(24) : error 017: undefined symbol "playerinfo"
C:\Users\Qaziii\Desktop\others\LOL.pwn(24) : error 029: invalid expression, assumed zero
C:\Users\Qaziii\Desktop\others\LOL.pwn(24) : error 017: undefined symbol "Shoes"
C:\Users\Qaziii\Desktop\others\LOL.pwn(24) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
5 Errors. Help ME Please I am New Scripter
Code:
#include <a_samp>
#include <sscanf>
#define SCM SendClientMessage
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define Pinfo PlayerInfo
#define COLOR_RED 0xFF0000FF
main()
{
print("\n----------------------------------");
print(" 1v1 DM server");
print("----------------------------------\n");
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(buyshoe, 7, cmdtext);
dcmd(Skick, 5, cmdtext);
dcmd(fakechat, 8, cmdtext);
return 1;
}
dcmd_buyshoe(playerid, params[])
{
if(GetPlayerMoney (playerid) < 300000) return SCM(playerid, COLOR_RED, "* You don't have $300000 to buy 1 Shoe.");
if(playerinfo (playerid)[Shoes] == 5) return SCM(playerid, COLOR_RED, "* You could not carry more than 5 shoes.");
pInfo[playerid][Shoes] ++;
new str1[100];
GivePlayerMoney(playerid, -300000);
format(str1,sizeof(str1),"[Super Shoe] You have bought 1 Shoe. - use /kick to use them. (Total Shoes: %d)", pInfo[playerid][Shoes]);
SendClientMessage(playerid, COLOR_ROYALBLUE, str1);
return 1;
}
dcmd_Skick(playerid, params[])
{
new nPlayer = GetClosestPlayer(playerid);
if(sscanf(skick,7 "us[127]", id, kick)) return SendClientMessage(playerid,0xFF7800FF, "Usage: /skick [ID]");
//if(RestrictCMD == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command reason:[DISABLED]");
if(spawned[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command While Dead.");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"You Cannot Use This Command While In A Vehicle.");
if(spawned[nPlayer] == 0) return SendClientMessage(playerid, COLOR_RED, "You Cannot Kick A Dead Body.");
//if(OnDuty[nPlayer] == 1) return SendClientMessage(playerid, COLOR_RED, "You cannot use this command on an admin on duty");
//if(IsInChallenge[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You cannot rape in a challenge. You can take drugs and use /ad.");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"Error: You cannot use this command in a vehicle.");
//if(IsSpecing[nPlayer] == 1) return SendClientMessage(playerid, COLOR_RED, "Nobody close enough to Kick.");
//if(duel[nPlayer] == 1) return SendClientMessage(playerid, COLOR_RED, "you cannot kick in duel area");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
if(kick[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"Error: Please wait before Kicking again.");
if(IsPlayerInRangeOfPoint(nPlayer,6.0,x,y,z))
{
OnPlayerConnect:SendClientMessage:Welcome To DM
if(aduty[nPlayer] == 1) return SCM(playerid, COLOR_RED,"You can't use this command on onduty admin.");
//if(pInfo[nPlayer][Adminlevel] > 1) return SendClientMessage(playerid, COLOR_RED, ""ERROR_MESSAGE"");
if(IsPlayerInAnyVehicle(nPlayer)) return SendClientMessage(playerid,COLOR_RED,"Error: The nearest player is in a vehicle.");
kick[playerid] =1;
gnstwall_injured[playerid] = SetTimerEx("gnstwall_injurd", 4.0, 1, 0, 0, 0, 0);
switch(random(10))
}
dcmd_fakechat(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new id,text[128];
if(sscanf(params, "us[127]", id, text)) return SendClientMessage(playerid,0xFF7800FF, "Usage: /fakechat [ID] [TEXT]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid ,0xFF7800FF, "player offline");
SendPlayerMessageToAll(id,text);
return 1;
}
return 0;
}
Re: 017: undefined Symbol Helpppp -
Firewire - 17.04.2014
You were missing a closing bracket for "SKICK".
You were told in this post what to do:
https://sampforum.blast.hk/showthread.php?tid=507341
pawn Code:
dcmd_Skick(playerid, params[])
{
new nPlayer = GetClosestPlayer(playerid);
if(sscanf(skick,7 "us[127]", id, kick)) return SendClientMessage(playerid,0xFF7800FF, "Usage: /skick [ID]");
//if(RestrictCMD == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command reason:[DISABLED]");
if(spawned[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command While Dead.");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"You Cannot Use This Command While In A Vehicle.");
if(spawned[nPlayer] == 0) return SendClientMessage(playerid, COLOR_RED, "You Cannot Kick A Dead Body.");
//if(OnDuty[nPlayer] == 1) return SendClientMessage(playerid, COLOR_RED, "You cannot use this command on an admin on duty");
//if(IsInChallenge[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You cannot rape in a challenge. You can take drugs and use /ad.");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"Error: You cannot use this command in a vehicle.");
//if(IsSpecing[nPlayer] == 1) return SendClientMessage(playerid, COLOR_RED, "Nobody close enough to Kick.");
//if(duel[nPlayer] == 1) return SendClientMessage(playerid, COLOR_RED, "you cannot kick in duel area");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
if(kick[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"Error: Please wait before Kicking again.");
if(IsPlayerInRangeOfPoint(nPlayer,6.0,x,y,z))
{
OnPlayerConnect:SendClientMessage:Welcome To DM
if(aduty[nPlayer] == 1) return SCM(playerid, COLOR_RED,"You can't use this command on onduty admin.");
//if(pInfo[nPlayer][Adminlevel] > 1) return SendClientMessage(playerid, COLOR_RED, ""ERROR_MESSAGE"");
if(IsPlayerInAnyVehicle(nPlayer)) return SendClientMessage(playerid,COLOR_RED,"Error: The nearest player is in a vehicle.");
kick[playerid] =1;
gnstwall_injured[playerid] = SetTimerEx("gnstwall_injurd", 4.0, 1, 0, 0, 0, 0);
switch(random(10))
}
return 1;
}
Re: 017: undefined Symbol Helpppp -
Robber7 - 17.04.2014
C:\Users\Qaziii\Desktop\others\LOL.pwn(30) : error 017: undefined symbol "dcmd_fakechat"
C:\Users\Qaziii\Desktop\others\LOL.pwn(37) : error 017: undefined symbol "playerinfo"
C:\Users\Qaziii\Desktop\others\LOL.pwn(37) : error 029: invalid expression, assumed zero
C:\Users\Qaziii\Desktop\others\LOL.pwn(37) : error 017: undefined symbol "Shoes"
C:\Users\Qaziii\Desktop\others\LOL.pwn(37) : fatal error 107: too many error messages on one line
Help me In This
Code:
#include <a_samp>
#include <sscanf>
#define SCM SendClientMessage
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define Pinfo PlayerInfo
#define COLOR_RED 0xFF0000FF
#define COLOR_PINK 0xFFC0CBFF
#define COLOR_GREEN 0x008000FF
#define COLOR_DARKBLUE 0x00008BFF
#define COLOR_CADETBLUE 0x5F9EA0FF
#define COLOR_LIGHTBLUE 0xADD8E6FF
#define COLOR_YELLOW 0xECD400F6
#define COLOR_LIGHTGREEN 0x90EE90FF
#define COLOR_PEACHPUFF 0xFFDAB9FF
#define LIGHTBLUE2 0xF6BB0AA
#define COLOR_GREY 0x808080FF
#define COLOR_ORANGE 0xFFA500FF
#define COLOR_BISQUE 0xFFE4C4FF
#define COLOR_BLANCHEDALMOND 0xFFEBCDFF
main()
{
print("\n----------------------------------");
print(" 1v1 DM server");
print("----------------------------------\n");
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(buyshoe, 7, cmdtext);
dcmd(Skick, 5, cmdtext);
dcmd(fakechat, 8, cmdtext);
return 1;
}
dcmd_buyshoe(playerid, params[])
{
if(GetPlayerMoney (playerid) < 300000) return SCM(playerid, COLOR_RED, "* You don't have $300000 to buy 1 Shoe.");
if(playerinfo (playerid)[Shoes] == 5) return SCM(playerid, COLOR_RED, "* You could not carry more than 5 shoes.");
pInfo[playerid][Shoes] ++;
new str1[100];
GivePlayerMoney(playerid, -300000);
format(str1,sizeof(str1),"[Super Shoe] You have bought 1 Shoe. - use /kick to use them. (Total Shoes: %d)", pInfo[playerid][Shoes]);
SendClientMessage(playerid, COLOR_ROYALBLUE, str1);
return 1;
}
dcmd_Skick(playerid, params[])
{
new nPlayer = GetClosestPlayer(playerid);
if(sscanf(skick,7 "us[127]", id, kick)) return SendClientMessage(playerid,0xFF7800FF, "Usage: /skick [ID]");
//if(RestrictCMD == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command reason:[DISABLED]");
if(spawned[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command While Dead.");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"You Cannot Use This Command While In A Vehicle.");
if(spawned[nPlayer] == 0) return SendClientMessage(playerid, COLOR_RED, "You Cannot Kick A Dead Body.");
//if(OnDuty[nPlayer] == 1) return SendClientMessage(playerid, COLOR_RED, "You cannot use this command on an admin on duty");
//if(IsInChallenge[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You cannot rape in a challenge. You can take drugs and use /ad.");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"Error: You cannot use this command in a vehicle.");
//if(IsSpecing[nPlayer] == 1) return SendClientMessage(playerid, COLOR_RED, "Nobody close enough to Kick.");
//if(duel[nPlayer] == 1) return SendClientMessage(playerid, COLOR_RED, "you cannot kick in duel area");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
if(kick[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"Error: Please wait before Kicking again.");
if(IsPlayerInRangeOfPoint(nPlayer,6.0,x,y,z))
{
OnPlayerConnect:SendClientMessage:Welcome To DM
if(aduty[nPlayer] == 1) return SCM(playerid, COLOR_RED,"You can't use this command on onduty admin.");
//if(pInfo[nPlayer][Adminlevel] > 1) return SendClientMessage(playerid, COLOR_RED, ""ERROR_MESSAGE"");
if(IsPlayerInAnyVehicle(nPlayer)) return SendClientMessage(playerid,COLOR_RED,"Error: The nearest player is in a vehicle.");
kick[playerid] =1;
gnstwall_injured[playerid] = SetTimerEx("gnstwall_injurd", 4.0, 1, 0, 0, 0, 0);
switch(random(10))
}
return 1;
}
dcmd_fakechat(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new id,text[128];
if(sscanf(params, "us[127]", id, text)) return SendClientMessage(playerid,0xFF7800FF, "Usage: /fakechat [ID] [TEXT]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid ,0xFF7800FF, "player offline");
SendPlayerMessageToAll(id,text);
return 1;
}
return 0;
}
Re: 017: undefined Symbol Helpppp -
ChandraLouis - 17.04.2014
use ZCMD will be easier
that is what i suggesting
Re: 017: undefined Symbol Helpppp -
Firewire - 17.04.2014
Robber, your code is using variables that aren't even defined and functions that aren't declared. You have copied and pasted this from somewhere and not bothered to read the code properly.
Now I have corrected all of your code and commented "
//" all the variables that have been declared but not defined.
pawn Code:
#include <a_samp>
#include <sscanf>
#define SCM SendClientMessage
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define COLOR_RED 0xFF0000FF
main()
{
print("\n----------------------------------");
print(" 1v1 DM server");
print("----------------------------------\n");
}
enum PInfo
{
Shoes,
}
new PlayerInfo[MAX_PLAYERS][PInfo];
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(buyshoe, 7, cmdtext);
dcmd(Skick, 5, cmdtext);
dcmd(fakechat, 8, cmdtext);
return 1;
}
dcmd_buyshoe(playerid, params[])
{
#pragma unused params
if(GetPlayerMoney (playerid) < 300000) return SCM(playerid, COLOR_RED, "* You don't have $300000 to buy 1 Shoe.");
if(PlayerInfo[playerid][Shoes] == 5) return SCM(playerid, COLOR_RED, "* You could not carry more than 5 shoes.");
PlayerInfo[playerid][Shoes]++;
new str1[100];
GivePlayerMoney(playerid, -300000);
format(str1,sizeof(str1),"[Super Shoe] You have bought 1 Shoe. - use /kick to use them. (Total Shoes: %d)", PlayerInfo[playerid][Shoes]);
SendClientMessage(playerid, -1, str1);
return 1;
}
dcmd_Skick(playerid, params[])
{
#pragma unused params
new nPlayer = GetClosestPlayerToPlayer(playerid);
//if(RestrictCMD == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command reason:[DISABLED]");
//if(spawned[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command While Dead.");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"You Cannot Use This Command While In A Vehicle.");
//if(spawned[nPlayer] == 0) return SendClientMessage(playerid, COLOR_RED, "You Cannot Kick A Dead Body.");
//if(OnDuty[nPlayer] == 1) return SendClientMessage(playerid, COLOR_RED, "You cannot use this command on an admin on duty");
//if(IsInChallenge[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You cannot rape in a challenge. You can take drugs and use /ad.");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"Error: You cannot use this command in a vehicle.");
//if(IsSpecing[nPlayer] == 1) return SendClientMessage(playerid, COLOR_RED, "Nobody close enough to Kick.");
//if(duel[nPlayer] == 1) return SendClientMessage(playerid, COLOR_RED, "you cannot kick in duel area");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
//if(kick[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"Error: Please wait before Kicking again.");
if(IsPlayerInRangeOfPoint(nPlayer,6.0,x,y,z))
{
//OnPlayerConnect:SendClientMessage:Welcome To DM
//if(aduty[nPlayer] == 1) return SCM(playerid, COLOR_RED,"You can't use this command on onduty admin.");
//if(pInfo[nPlayer][Adminlevel] > 1) return SendClientMessage(playerid, COLOR_RED, ""ERROR_MESSAGE"");
if(IsPlayerInAnyVehicle(nPlayer)) return SendClientMessage(playerid,COLOR_RED,"Error: The nearest player is in a vehicle.");
//kick[playerid] =1;
//gnstwall_injured[playerid] = SetTimerEx("gnstwall_injurd", 4.0, 1, 0, 0, 0, 0);
Kick(nPlayer);
}
return 1;
}
dcmd_fakechat(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new id,text[128];
if(sscanf(params, "us[127]", id, text)) return SendClientMessage(playerid,0xFF7800FF, "Usage: /fakechat [ID] [TEXT]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid ,0xFF7800FF, "player offline");
SendPlayerMessageToAll(id,text);
return 1;
}
return 0;
}
forward GetClosestPlayerToPlayer(playerid);
public GetClosestPlayerToPlayer(playerid)
{
new Float:dist = 1000.0;
new targetid = INVALID_PLAYER_ID;
new Float:x1,Float:y1,Float:z1;
new Float:x2,Float:y2,Float:z2;
new Float:tmpdis;
GetPlayerPos(playerid,x1,y1,z1);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(i == playerid) continue;
GetPlayerPos(i,x2,y2,z2);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
if(tmpdis < dist)
{
dist = tmpdis;
targetid = i;
}
}
return targetid;
}
Your PlayerInfo define didn't work and therefore resulted me putting it into an Enum, to call "Shoes" use PlayerInfo[playerid][Shoes].
I hope this has helped.
Re: 017: undefined Symbol Helpppp -
Robber7 - 17.04.2014
Thank You Very Very Much!!!! it Worked
Re: 017: undefined Symbol Helpppp -
Robber7 - 18.04.2014
I have Now That File,s amx But in Server Its Not Working WHy?
Re: 017: undefined Symbol Helpppp -
Firewire - 18.04.2014
Because you haven't:
1) Installed the correct plugins and added them in your plugins folder and made a line called plugins in your server.cfg
2) You haven't added the file name on the gamemode line in server.cfg. As I recall, your gamemode is called "LOL" so you would need to look for "Gamemode" and check if it has these parameters. "Gamemode0 LOL 1"
Hope that helps.
Re: 017: undefined Symbol Helpppp -
Robber7 - 25.04.2014
Please Help Bro Its Not Working In Server!!!!!!!