Unsuspect Command Not working ( Requesting Lock )
#1

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
Reply
#2

Paste the pawn compiler output and the code on that line
Reply
#3

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);
}
Reply
#4

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
Reply
#5

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;
Reply
#6

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);
}
....
Reply
#7

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.
Reply
#8

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?
Reply
#9

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
Reply
#10

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)