Please Help! Need help with format! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Please Help! Need help with format! (
/showthread.php?tid=391676)
Need Help with /su CMD -
adithegman - 11.11.2012
I have a problem with a format:
Код:
CMD:suspect(playerid,params[])
{
if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if(PlayerInfo[playerid][pLogged] == 0) return SendClientMessage(playerid,COLOR_WHITE,"*** Trebuie sa te logezi/inregistrezi mai intai.");
if(CopOnDuty[playerid] == 0) return SendClientMessage(playerid,COLOR_WHITE,"You are not on Duty!");
new id,wantedlevel,crime[128],string[128];
new CopName[MAX_PLAYER_NAME],SuspectName[MAX_PLAYER_NAME];
if(sscanf(params,"uui[128]",id,wantedlevel,crime)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: (/su)spect [playerid] [1-6] [crime]");
if(playerid == id) return SendClientMessage(playerid,COLOR_WHITE,"You cannot suspect yourself!");
if(PlayerInfo[id][pFaction] == 1 || PlayerInfo[id][pLeader] == 1) return SendClientMessage(playerid,COLOR_WHITE,"You cannot give wanted to a Cop!");
if(wantedlevel == PlayerInfo[id][pWanted]) return SendClientMessage(playerid,COLOR_WHITE,"That player is already a suspect!");
SetPlayerWantedLevel(id,wantedlevel);
PlayerInfo[id][pWanted] = wantedlevel;
GetPlayerName(playerid,CopName,sizeof(CopName));
GetPlayerName(id,SuspectName,sizeof(SuspectName));
foreach(new i:Player)
{
if(PlayerInfo[i][pFaction] == 1 || PlayerInfo[i][pLeader] == 1)
{
format(string,sizeof(string),"Suspect: "COLOR_RED"%s {0x0000FFFF}Crime: "COLOR_RED"%s {0x0000FFFF}Reporter: "COLOR_RED"%s",SuspectName,crime,CopName);
SendClientMessage(i,0x0000FFFF,"HQ: All Units, Crime Report:");
SendClientMessage(i,0x0000FFFF,string);
print("(PD/FBI/NG Chat) HQ: All Units, Crime Report:");
print(string);
}
}
}
else
{
SendClientMessage(playerid,COLOR_WHITE,"You are not a COP/FBI Agent/NG!");
}
return 1;
}
CMD:su(playerid,params[]) return cmd_suspect(playerid,params);
Here are the errors
Код:
...\Desktop\New\gamemodes\FreeServer.pwn(2059) : error 001: expected token: "-string end-", but found "-identifier-"
...\Desktop\New\gamemodes\FreeServer.pwn(2059) : error 001: expected token: "-string end-", but found "-identifier-"
...\Desktop\New\gamemodes\FreeServer.pwn(2059) : warning 215: expression has no effect
...\Desktop\New\gamemodes\FreeServer.pwn(2059) : error 001: expected token: ";", but found "-integer value-"
...\Desktop\New\gamemodes\FreeServer.pwn(2059) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: Please Help! Need help with format! -
Konstantinos - 11.11.2012
pawn Код:
// At the top, under #include (s)
#define COLOR_RED "{00FFFF}"
Re: Please Help! Need help with format! -
adithegman - 11.11.2012
Nah... the same errors and i've already added it so....
Re: Please Help! Need help with format! -
Konstantinos - 11.11.2012
If it gives the same errors, then use the normal way.
pawn Код:
"This is a message with a {FFFFFF}color!"
It will not give you any error.
Re: Please Help! Need help with format! -
adithegman - 11.11.2012
Thanks man it works