18.06.2012, 05:51
I have tried to define it as new tmp; but yet I get more errors.
These errors are with the new tmp;
Did I do something wrong? Cause I have tried everything I can think of at this point.
Код:
error 017: undefined symbol "tmp" error 017: undefined symbol "tmp" error 017: undefined symbol "tmp" error 017: undefined symbol "tmp" error 017: undefined symbol "tmp" error 017: undefined symbol "sendername"
pawn Код:
if(strcmp(cmdtext, "/setdonator", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new idx;
new string[256];
new giveplayer[MAX_PLAYER_NAME];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setdonator [playerid/PartOfName] [level(1-4)]");
return 1;
}
new para1;
new level;
new plevel;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
plevel = pInfo[para1][Vip_Level];
if(pInfo[playerid][Admin] >= 7 || IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(para1))
{
new atext[32];
if(para1 != INVALID_PLAYER_ID)
{
if(level == plevel)
{
SendClientMessage(playerid, COLOR_GREY, "Already that level!");
return 1;
}
if(level < 0 || level > 4)
{
return SendClientMessage(playerid, COLOR_GREY,"Only levels 0-4 Are allowed!");
}
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
new Float:X, Float:Y, Float:Z;
GetPlayerPos(para1, X,Y,Z);
if(level == 1){ atext = "Platinum"; }
else if(level == 2){ atext = "Gold"; }
else if(level == 3){ atext = "Silver"; }
else if(level == 4){ atext = "Bronze"; }
if(level == 1)
{
format(string, sizeof(string), "[Donator]: %s (%d) to Donor %s; level:%d.", giveplayer, para1, atext, level);
SendClientMessage(playerid, COLOR_YELLOW2, string);
pInfo[para1][Vip_Level] = level;
}
if(level == 2)
{
format(string, sizeof(string), "[Donator]: %s (%d) to Donor %s; level:%d.", giveplayer, para1, atext, level);
SendClientMessage(playerid, COLOR_YELLOW2, string);
pInfo[para1][Vip_Level] = level;
}
if(level == 3)
{
format(string, sizeof(string), "[Donator]: %s (%d) to Donor %s; level:%d.", giveplayer, para1, atext, level);
SendClientMessage(playerid, COLOR_YELLOW2, string);
pInfo[para1][Vip_Level] = level;
}
if(level == 4)
{
format(string, sizeof(string), "[Donator]: %s (%d) to Donor %s; level:%d.", giveplayer, para1, atext, level);
SendClientMessage(playerid, COLOR_YELLOW2, string);
pInfo[para1][Vip_Level] = level;
}
if(level == 0)
{
format(string, sizeof(string), "[Donator]: Your Donator Rank expired,please refill it if you want it again.", giveplayer, para1, atext, level);
SendClientMessage(playerid, COLOR_YELLOW2, string);
pInfo[para1][Vip_Level] = level;
}
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Gave to %s Donator Rank: [%d].",d,m,y,h,mi,s,sendername,giveplayer,level);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Not authorized!");
return 1;
}
}
return 1;
}
Код:
error 006: must be assigned to an array error 035: argument type mismatch (argument 1) error 035: argument type mismatch (argument 1) error 006: must be assigned to an array error 035: argument type mismatch (argument 1) : error 017: undefined symbol "sendername" warning 204: symbol is assigned a value that is never used: "tmp"
pawn Код:
if(strcmp(cmdtext, "/setdonator", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new idx;
new tmp;
new string[256];
new giveplayer[MAX_PLAYER_NAME];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setdonator [playerid/PartOfName] [level(1-4)]");
return 1;
}
new para1;
new level;
new plevel;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
plevel = pInfo[para1][Vip_Level];
if(pInfo[playerid][Admin] >= 7 || IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(para1))
{
new atext[32];
if(para1 != INVALID_PLAYER_ID)
{
if(level == plevel)
{
SendClientMessage(playerid, COLOR_GREY, "Already that level!");
return 1;
}
if(level < 0 || level > 4)
{
return SendClientMessage(playerid, COLOR_GREY,"Only levels 0-4 Are allowed!");
}
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
new Float:X, Float:Y, Float:Z;
GetPlayerPos(para1, X,Y,Z);
if(level == 1){ atext = "Platinum"; }
else if(level == 2){ atext = "Gold"; }
else if(level == 3){ atext = "Silver"; }
else if(level == 4){ atext = "Bronze"; }
if(level == 1)
{
format(string, sizeof(string), "[Donator]: %s (%d) to Donor %s; level:%d.", giveplayer, para1, atext, level);
SendClientMessage(playerid, COLOR_YELLOW2, string);
pInfo[para1][Vip_Level] = level;
}
if(level == 2)
{
format(string, sizeof(string), "[Donator]: %s (%d) to Donor %s; level:%d.", giveplayer, para1, atext, level);
SendClientMessage(playerid, COLOR_YELLOW2, string);
pInfo[para1][Vip_Level] = level;
}
if(level == 3)
{
format(string, sizeof(string), "[Donator]: %s (%d) to Donor %s; level:%d.", giveplayer, para1, atext, level);
SendClientMessage(playerid, COLOR_YELLOW2, string);
pInfo[para1][Vip_Level] = level;
}
if(level == 4)
{
format(string, sizeof(string), "[Donator]: %s (%d) to Donor %s; level:%d.", giveplayer, para1, atext, level);
SendClientMessage(playerid, COLOR_YELLOW2, string);
pInfo[para1][Vip_Level] = level;
}
if(level == 0)
{
format(string, sizeof(string), "[Donator]: Your Donator Rank expired,please refill it if you want it again.", giveplayer, para1, atext, level);
SendClientMessage(playerid, COLOR_YELLOW2, string);
pInfo[para1][Vip_Level] = level;
}
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Gave to %s Donator Rank: [%d].",d,m,y,h,mi,s,sendername,giveplayer,level);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Not authorized!");
return 1;
}
}
return 1;
}