SA-MP Forums Archive
[HELP] Fine command - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Fine command (/showthread.php?tid=70460)



[HELP] Fine command - Hot - 24.03.2009

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




Re: [HELP] Fine command - Mikep - 24.03.2009

[ pawn ] tags and indentation please.


Re: [HELP] Fine command - Hot - 24.03.2009

Here it goes ,

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


Re: [HELP] Fine command - Mikep - 24.03.2009

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


Re: [HELP] Fine command - Hot - 24.03.2009

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


Re: [HELP] Fine command - Mikep - 24.03.2009

Jocking, you are a born entertainer!

I don't know the problem, too tired.


Re: [HELP] Fine command - ICECOLDKILLAK8 - 24.03.2009

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


Re: [HELP] Fine command - Klutty - 25.03.2009

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


Re: [HELP] Fine command - Dujma - 25.03.2009

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...