[HELP] Fine command
#1

So , i am making a /fine command... and i want to do it as the simple way i can ... i made this code from my head :


pawn Код:
if(strcmp, cmdtext, "/fine", true) == 0) {

 tmp = strtok(cmdtext, idx);
  if(!strlen(tmp)) {
  SendClientMessage(playerid, COLOR_ERROR, "[SERVER] USAGE: /fine [Playerid]");
  return 1;
  }

  if(gTeam[playerid] != COPS ) {
  SendClientMessage(playerid,COLOR_ERROR,"[SERVER] You are not a cop");
  return 1;
  }
  if(Wanted[giveplayerid] != 1) {
  SendClientMessage(playerid,COLOR_ERROR,"[SERVER] This Player isn't Wanted!");
  return 1;
  }
  giveplayerid = strval(tmp);
  if(!IsPlayerConnected(giveplayerid)) {
  format(string, sizeof(string), "[SERVER] ID (%d) is not an active player", giveplayerid);
  SendClientMessage(playerid, COLOR_ERROR, string);
  return 1;
  }
  if(GetDistanceBetweenPlayers(playerid,giveplayerid) > 8) {
  SendClientMessage(playerid,COLOR_ERROR, "[SERVER] You are not close enough");
  return 1;
  }
  if(GetPlayerWantedLevel(giveplayerid) == 3) {
  format(string, sizeof(string), "[SERVER] Officer %s(%d) has fined you $2000. Your wanted level has been reduced ",oname,playerid);
  SendClientMessage(giveplayerid,YELLOW, string);
  format(string, sizeof(string), "~w~You have been fined~n~ ~b~$500");
  GameTextForPlayer(giveplayerid, string,5000, 0);
  Wanted[giveplayerid] == 0
  GivePlayerMoney(giveplayerid, -500);
  format(string, sizeof(string), "[SERVER] You have issued a fine to %s(%d) and you receive a collection bonus of $500",pname,giveplayerid);
  SendClientMessage(playerid,COLOR_YELLOW, string);
  GivePlayerMoney(playerid, 500);
  return 1;
  }
}

Reply
#2

[ pawn ] tags and indentation please.
Reply
#3

Here it goes ,

now say me, is this code correct ? if's not , say what is wrong and how fix
Reply
#4

me, is this code correct ? if's not , say what is wrong and how fix
Reply
#5

STOP JOCKING WITH ME, my english sucks , so please help meeee
Reply
#6

Jocking, you are a born entertainer!

I don't know the problem, too tired.
Reply
#7

I think you missed a bracket in the last section of the code
Reply
#8

When you compile, are there any errors on any of the lines used for that?

If not, why did you post here?


EDIT: Put a opening "{" under
pawn Код:
if(strcmp, cmdtext, "/fine", true) == 0)
 {
i think, :P
Reply
#9

Quote:
Originally Posted by Hot
So , i am making a /fine command... and i want to do it as the simple way i can ... i made this code from my head :
Good for you... And the reason you are posting here is? Can you explain what is the problem with this command...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)