Wanted stars
#1

I got this bug, when you do /su ID REASON the players get an crime, but no star
how can i make it appear an star for each su' he gets?

And it has to be removed when he gets jailed etc, or lawyer'ed, thank you!
Reply
#2

https://sampwiki.blast.hk/wiki/SetPlayerWantedLevel
Reply
#3

i did, but i got one error, 'undefined symbol level' but when i '#define level 6' it gave me 26 errors, honestly i dont know what to do, any help?
Reply
#4

It helps if you give us the errors.
Reply
#5

error 017: undefined symbol "level"
Reply
#6

Quote:
Originally Posted by andershh
Посмотреть сообщение
i did, but i got one error, 'undefined symbol level' but when i '#define level 6' it gave me 26 errors, honestly i dont know what to do, any help?
You aren't supposed to #define the level.
Read the wiki page I gave you above and you'll know how to use It.

The box with the EXAMPLE HOW TO USE IT. NOTHING can be easier to understand then the wiki..
Reply
#7

That didnt explain how to fix that error.
Reply
#8

This is my command, i belive im wrong, am i?

Quote:

//----------------------------------[SetCrim]-----------------------------------------------
if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " You are not on Duty!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/su)spect [playerid/PartOfName] [crime discription]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (gTeam[playerid] == 2 || IsACop(playerid))
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (gTeam[giveplayerid] != 2)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/su)spect [playerid/PartOfName] [crime text]");
return 1;
}
if(PlayerInfo[giveplayerid][pWantedLevel] > 7)
{
SendClientMessage(playerid, COLOR_GRAD2, "Player has maximum wanted level!");
return 1;
}
else
{
PlayerInfo[giveplayerid][pWantedLevel]++;
SetPlayerWantedLevel(playerid, level);
SetPlayerCriminal(giveplayerid,playerid, result);
//factionlog(string);
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " You can't suspect a Cop !");
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not a Cop / FBI / SAHP !");
}
}
return 1;
}

Should i put SetPlayerWantedLevel(playerid, 1); instead of SetPlayerWantedLevel(playerid, level);
Reply
#9

SetPlayerWantedLevel(playerid, 1); gave me one star, how can i make it give someone else it? and i am only available to give one
Reply
#10

Quote:
Originally Posted by andershh
Посмотреть сообщение
SetPlayerWantedLevel(playerid, 1); gave me one star, how can i make it give someone else it? and i am only available to give one
I< DID explain how to fix your error. Remove #define level 6. The Wiki explained how to use the function correct.

Look at the wiki once again.... SetPlayerWantedLevel(playerid,<HOWMANYSTARSYOUWANT >);

EXAMPLE:
SetPlayerWantedLevel(playerid,1); = 1 stars
SetPlayerWantedLevel(playerid,2); = 2 stars
SetPlayerWantedLevel(playerid,3); = 3 stars
SetPlayerWantedLevel(playerid,4); = 4 stars
SetPlayerWantedLevel(playerid,5); = 5 stars
SetPlayerWantedLevel(playerid,6); = 6 stars

And as for this /su command (Will not work ANYWHERE, but IN THIS COMMAND it will)
use giveplayerid instead of playerid.

Example: SetPlayerWantedLevel(giveplayerid,6); will give him 6 stars. Change the 6 to another number to give another amount of stars.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)