Unsuspect Command Not working ( Requesting Lock ) -
Alex_Smitholie - 13.06.2010
I'm having trouble with a unsuspect command,
pawn Код:
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "You Have cleared %s's crimes!",giveplayer);
SendClientMessage(playerid,COLOR_LIGHTRED,string);
GameTextForPlayer(giveplayerid, "~w~Unsuspected!", 5000, 3);
format(string, sizeof(string), "[ADMIN]: %s Has Unsuspected %s (%d)",sendername, giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED,string, 5);
ClearCrime(giveplayerid);
format(string, sizeof(string), "%s(%d) has unsuspected %s(%d) reason: %s",sendername, giveplayerid, giveplayer, giveplayerid, );
SendRadioMessage(3, COLOR_DUTY, string);
SendRadioMessage(2, COLOR_DUTY, string);
SendRadioMessage(1, COLOR_DUTY, string);
format(string, sizeof(string), "Unsupected be a good citizen!",sendername)
SendClientMessage(giveplayerid, COLOR_LIME, string);
SetPlayerToTeamColor(giveplayerid);
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 Unsuspected to %s",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
Quote:
format(string, sizeof(string), "%s(%d) has unsuspected %s(%d) reason: %s",sendername, giveplayerid, giveplayer, giveplayerid, );
|
When i compile, IT works but when i use /cancelsuspect id reason, the reason won't show up... But when i add reason into the sendername, giveplayerid, giveplayer, giveplayerid pawn has a error 017
Re: Unsuspect Command Not working - TheInnocentOne - 13.06.2010
Paste the pawn compiler output and the code on that line
Re: Unsuspect Command Not working -
Cameltoe - 13.06.2010
And Please use super-fine code Function this forum got!
Код:
new code,nice;
code = "a nice great thing!";
if (code == "a nice great thing!")
{
nice = "Everything suddenly starts too look so much better!";
SendClientMessageToAll(white,nice);
}
Re: Unsuspect Command Not working -
Alex_Smitholie - 13.06.2010
format(string, sizeof(string), "%s(%d) has unsuspected %s(%d) reason: %s",sendername, giveplayerid, giveplayer, giveplayerid, reason);
C:\Users\ALEX\Desktop\detroit rp\gamemodes\larp.pwn(52242) : error 017: undefined symbol "reason"
C:\Users\ALEX\Desktop\detroit rp\gamemodes\larp.pwn(72583) : warning 203: symbol is never used: "CopNames"
C:\Users\ALEX\Desktop\detroit rp\gamemodes\larp.pwn(72583) : warning 203: symbol is never used: "FbiNames"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
don't mind the warnings
Re: Unsuspect Command Not working -
Blt950 - 13.06.2010
Quote:
Originally Posted by Cameltoe
And Please use super-fine code Function this forum got!
Код:
new code,nice;
code = "a nice great thing!";
if (code == "a nice great thing!")
{
nice = "Everything suddenly starts too look so much better!";
SendClientMessageToAll(white,nice);
}
|
Is it just me, or I just see a failure in that "super-fine".. Since you are adding text into 'code' I think you should make it
pawn Код:
new code[64];
INSTEAD OF
new code;
Re: Unsuspect Command Not working -
Alex_Smitholie - 13.06.2010
Quote:
Originally Posted by Cameltoe
And Please use super-fine code Function this forum got!
Код:
new code,nice;
code = "a nice great thing!";
if (code == "a nice great thing!")
{
nice = "Everything suddenly starts too look so much better!";
SendClientMessageToAll(white,nice);
}
|
....
Re: Unsuspect Command Not working -
Blt950 - 13.06.2010
Quote:
Originally Posted by UltimateRolePlayRPG
format(string, sizeof(string), "%s(%d) has unsuspected %s(%d) reason: %s",sendername, giveplayerid, giveplayer, giveplayerid, reason);
C:\Users\ALEX\Desktop\detroit rp\gamemodes\larp.pwn(52242) : error 017: undefined symbol "reason"
C:\Users\ALEX\Desktop\detroit rp\gamemodes\larp.pwn(72583) : warning 203: symbol is never used: "CopNames"
C:\Users\ALEX\Desktop\detroit rp\gamemodes\larp.pwn(72583) : warning 203: symbol is never used: "FbiNames"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
don't mind the warnings
|
I think you forgot to define the variable "reason" ?
That is why it's not finding it, displays a error.
Re: Unsuspect Command Not working -
Dark_Kostas - 13.06.2010
Can you show us the whole /unsuspect command? And use [ pawn] [ /pawn] tags please.
Quote:
Originally Posted by Cameltoe
And Please use super-fine code Function this forum got!
Код:
new code,nice;
code = "a nice great thing!";
if (code == "a nice great thing!")
{
nice = "Everything suddenly starts too look so much better!";
SendClientMessageToAll(white,nice);
}
|
WTF is this?
Re: Unsuspect Command Not working -
Alex_Smitholie - 13.06.2010
Quote:
Originally Posted by Blt950
Quote:
Originally Posted by UltimateRolePlayRPG
format(string, sizeof(string), "%s(%d) has unsuspected %s(%d) reason: %s",sendername, giveplayerid, giveplayer, giveplayerid, reason);
C:\Users\ALEX\Desktop\detroit rp\gamemodes\larp.pwn(52242) : error 017: undefined symbol "reason"
C:\Users\ALEX\Desktop\detroit rp\gamemodes\larp.pwn(72583) : warning 203: symbol is never used: "CopNames"
C:\Users\ALEX\Desktop\detroit rp\gamemodes\larp.pwn(72583) : warning 203: symbol is never used: "FbiNames"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
don't mind the warnings
|
I think you forgot to define the variable "reason" ?
That is why it's not finding it, displays a error.
|
how do i define it then
Re: Unsuspect Command Not working -
Alex_Smitholie - 13.06.2010
if(strcmp(cmd, "/cancelsuspect", true) == 0) // by GrandpaNicholes
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /cancelsuspect [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 2 || IsACop(playerid) && PlayerInfo[playerid][pRank] >= 4)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (PlayerInfo[giveplayerid][pWanted] == 0)
{
SendClientMessage(playerid,COLOR_NICERED,"Player not Wanted!");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "You Have cleared %s's crimes!",giveplayer);
SendClientMessage(playerid,COLOR_LIGHTRED,string);
GameTextForPlayer(giveplayerid, "~w~Unsuspected!", 5000, 3);
format(string, sizeof(string), "[ADMIN]: %s Has Unsuspected %s (%d)",sendername, giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED,string, 5);
ClearCrime(giveplayerid);
format(string, sizeof(string), "%s(%d) has unsuspected %s(%d) reason: %s",sendername, giveplayerid, giveplayer, giveplayerid, reason);
SendRadioMessage(3, COLOR_DUTY, string);
SendRadioMessage(2, COLOR_DUTY, string);
SendRadioMessage(1, COLOR_DUTY, string);
format(string, sizeof(string), "Unsupected be a good citizen!",sendername)
SendClientMessage(giveplayerid, COLOR_LIME, string);
SetPlayerToTeamColor(giveplayerid);
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 Unsuspected to %s",d,m,y,h,mi,s,sendername,giveplayer);
GiveLog(string);
}
}
else
{
format(string, sizeof(string), "** %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "YOur rank is to low to use this command!");
}
}
return 1;
}