[Help]Error -
alekschowee - 18.07.2016
Код:
if(!strcmp(cmd,"/setprefix",true))
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid,COLOR_WHITE,"Usage: /setprefix [playerid] [Prefix text]");
}
new para1,prefix[60];
para1 = ReturnUser(tmp);
prefix = strtok(cmdtext,idx);
printf("PREFIX: %s",prefix);
if(!strlen(prefix))
{
return SendClientMessage(playerid,COLOR_WHITE,"Usage: /setprefix [playerid] [Prefix text]");
}
if(pInfo[playerid][Adminlevel] >= 6 || IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1,giveplayer,sizeof giveplayer);
format(string,sizeof string,"PREFIX: Administrator {FFFF00}%s{00FFFF} set you PREFIX{FFFF00} %s{00FFFF}. Congratulations!",PlayerName(playerid),prefix);
SendClientMessage(para1,COLOR_ORANGE,string);
strcat(pInfo[para1][Prefix],prefix);
format(string, sizeof(string), "PREFIX: {FFFF00}%s {00FFFF} now have PREFIX {FFFF00}%s{00FFFF}. Congratulations!", giveplayer, prefix);
SendClientMessageToAll(COLOR_ORANGE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You have no access to this command!");
}
return 1;
}
Код:
Error:(14006) : error 017: undefined symbol "Prefix"
Код:
strcat(pInfo[para1][Prefix],prefix);
Re: [Help]Error -
UltraScripter - 18.07.2016
Add it on top
and i recommend you to use izcmd + sscanf thats faster and easier!
Re: [Help]Error -
AliBro - 18.07.2016
Код:
if(!strcmp(cmd,"/setprefix",true))
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid,COLOR_WHITE,"Usage: /setprefix [playerid] [Prefix text]");
}
new para1,prefix[60];
para1 = ReturnUser(tmp);
prefix = strtok(cmdtext,idx);
printf("PREFIX: %s",prefix);
if(!strlen(prefix))
{
return SendClientMessage(playerid,COLOR_WHITE,"Usage: /setprefix [playerid] [Prefix text]");
}
if(pInfo[playerid][Adminlevel] >= 6 || IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1,giveplayer,sizeof giveplayer);
format(string,sizeof string,"PREFIX: Administrator {FFFF00}%s{00FFFF} set you PREFIX{FFFF00} %s{00FFFF}. Congratulations!",PlayerName(playerid),prefix);
SendClientMessage(para1,COLOR_ORANGE,string);
strcat(pInfo[para1][prefix],prefix);
format(string, sizeof(string), "PREFIX: {FFFF00}%s {00FFFF} now have PREFIX {FFFF00}%s{00FFFF}. Congratulations!", giveplayer, prefix);
SendClientMessageToAll(COLOR_ORANGE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You have no access to this command!");
}
return 1;
}
Re: [Help]Error -
GangstaSunny - 18.07.2016
Does "pInfo[para1][Prefix]" realy exists?
Re: [Help]Error -
alekschowee - 18.07.2016
Код:
(14006) : error 033: array must be indexed (variable "prefix")
Re: [Help]Error -
AliBro - 18.07.2016
Код:
new Prefix[MAX_PLAYERS]; // place it where your all MAX_PLAYERS are
if(!strcmp(cmd,"/setprefix",true))
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid,COLOR_WHITE,"Usage: /setprefix [playerid] [Prefix text]");
}
new para1,prefix[60];
para1 = ReturnUser(tmp);
prefix = strtok(cmdtext,idx);
printf("PREFIX: %s",prefix);
if(!strlen(prefix))
{
return SendClientMessage(playerid,COLOR_WHITE,"Usage: /setprefix [playerid] [Prefix text]");
}
if(pInfo[playerid][Adminlevel] >= 6 || IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1,giveplayer,sizeof giveplayer);
format(string,sizeof string,"PREFIX: Administrator {FFFF00}%s{00FFFF} set you PREFIX{FFFF00} %s{00FFFF}. Congratulations!",PlayerName(playerid),prefix);
SendClientMessage(para1,COLOR_ORANGE,string);
strcat(pInfo[para1][Prefix],prefix);
format(string, sizeof(string), "PREFIX: {FFFF00}%s {00FFFF} now have PREFIX {FFFF00}%s{00FFFF}. Congratulations!", giveplayer, prefix);
SendClientMessageToAll(COLOR_ORANGE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You have no access to this command!");
}
return 1;
}
Re: [Help]Error -
GangstaSunny - 18.07.2016
Add "Prefix[60]" to your "pInfo" enum and dont use the code from AliBro
Re: [Help]Error -
alekschowee - 18.07.2016
Not working
Re: [Help]Error -
GangstaSunny - 18.07.2016
Show me your pInfo Enum
Re: [Help]Error -
alekschowee - 18.07.2016
Код:
enum pInfo
{
pMutedTime, //Тук ще се запише времето за което е заглушен
pTest,
pKey[256],
ExpS,
pTazerBullets,
pIP[21],
pO,
pRobTime,
pJobTimer,
pIgnorePM,
pNPM,
VGod,
pAdmin,
pCOP,
pSilenSkill,
Prefix[60],
pDrugPerk,
pDrugs,
pDis,
pEvent,
pAccount,
pManage,
pDuty,
aTog,
pRank,
pMember,
pBanned,
pBlock,
pDonateRank,
pBV,
pWarns,
pAWarns,
pFWarns,
pReg,
pCash,
pKills,
pDeaths,
pGun0,
pGun1,
pGun2,
pGun3,
pGun4,
pGun5,
pGun6,
pGun7,
pGun8,
pGun9,
pGun10,
pGun11,
pGun12,
pModel,
pMuted,
prMuted,
ptrMuted,
ptMuted,
pvMuted,
paMuted,
pvtMuted,
patMuted,
pfMuted,
pftMuted,
pSpree,
Float:pCalcSec,
pCWons,
pLotto,
pHide,
pJailed,
pCrimes,
pWantedLevel,
pWantedDeaths,
pJail,
pHealme,
pFixme,
pRes,
pKill,
pArmourme,
AFKstatus,
Level,
Exp,
pJailTime,
WsSkill,
pDmon,
pV,
EpSkill,
LevelSkill,
MoneySkill
};
new PlayerInfo[MAX_PLAYERS][pInfo];
Код:
if(!strcmp(cmd,"/setprefix",true))
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid,COLOR_WHITE,"Usage: /setprefix [playerid] [Prefix text]");
}
new para1,prefix[60];
para1 = ReturnUser(tmp);
prefix = strtok(cmdtext,idx);
printf("PREFIX: %s",prefix);
if(!strlen(prefix))
{
return SendClientMessage(playerid,COLOR_WHITE,"Usage: /setprefix [playerid] [Prefix text]");
}
if (PlayerInfo[playerid][pAdmin] >= 6)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1,giveplayer,sizeof giveplayer);
format(string,sizeof string,"PREFIX: Administrator {FFFF00}%s{00FFFF} set you PREFIX{FFFF00} %s{00FFFF}. Congratulations!",PlayerName(playerid),prefix);
SendClientMessage(para1,COLOR_ORANGE,string);
strcat(PlayerInfo[para1][Prefix],prefix);
format(string, sizeof(string), "PREFIX: {FFFF00}%s {00FFFF} now have PREFIX {FFFF00}%s{00FFFF}. Congratulations!", giveplayer, prefix);
SendClientMessageToAll(COLOR_ORANGE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You have no access to this command!");
}
return 1;
}