Author Topic: [BROKEN] Easy Clan War System by XD [ME]  (Read 6012 times)

0 Members and 1 Guest are viewing this topic.

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
[BROKEN] Easy Clan War System by XD [ME]
« on: April 04, 2013, 10:23:47 pm »
Quote
Moderator Notice



The script or include described below does not work as advertised. Please see this link for more details.

Do not modify or remove this notice until any issues have been resolved.
This notice was added by stormeus.




[pawn]            else if (strcmp(cmd, "clanwar", true) == 0)
      {
          tmp = strtok(cmdtext, idx);
          SetGameModeText("ClanWar Street");
         if(!strlen(tmp)) {
            format(szMsg,sizeof(szMsg),"clanwar setted to loc to %s", GetPlayerLocation(playerid));
            format(szMsg,sizeof(szMsg),"clanwar is now active of %s", tmp);
    SendClientMessage(playerid, COLOR_GREEN, szMsg);
    SendClientMessage(playerid, COLOR_GREEN, szMsg);
            SetPlayerRandomJailSpawns(playerid);
         } else {
            format(szMsg,sizeof(szMsg),"clanwar setted to loc to %s", GetPlayerLocation(playerid));
            format(szMsg,sizeof(szMsg),"clanwar is now active of %s", tmp);
    SendClientMessage(playerid, COLOR_GREEN, szMsg);
    SendClientMessage(playerid, COLOR_GREEN, szMsg);
            SetPlayerRandomJailSpawns(playerid);
          }
          SendClientMessage(playerid, COLOR_GREEN, szMsg);
          SendClientMessage(playerid, COLOR_GREEN, szMsg);
          SendClientMessage(playerid, COLOR_GREEN, szMsg);
          SendClientMessage(playerid, COLOR_GREEN, szMsg);
         return 1;
      }[/pawn]

XD SEE BUGGS
« Last Edit: April 04, 2013, 11:13:11 pm by stormeus »
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: Easy Clan War System by XD [ME]
« Reply #1 on: April 04, 2013, 11:04:44 pm »
Quote
[pawn]
format(szMsg,sizeof(szMsg),"clanwar setted to loc to %s", GetPlayerLocation(playerid));
format(szMsg,sizeof(szMsg),"clanwar is now active of %s", tmp);
SendClientMessage(playerid, COLOR_GREEN, szMsg);
SendClientMessage(playerid, COLOR_GREEN, szMsg);
[/pawn]
This violates rules of ordered instructions in programming and scripting. The script follows the code in the exact order that it is given. When you set the message in szMsg twice in a row, and then try to send both of your messages, you're going to end up with this:

clanwar is now active of my_war_area
clanwar is now active of my_war_area


What you need to do is format the first message, send it, and then, and only then, can you format the second message and send that.



Quote
[pawn]
if(!strlen(tmp)) {
    format(szMsg,sizeof(szMsg),"clanwar setted to loc to %s", GetPlayerLocation(playerid));
    format(szMsg,sizeof(szMsg),"clanwar is now active of %s", tmp);
    SendClientMessage(playerid, COLOR_GREEN, szMsg);
    SendClientMessage(playerid, COLOR_GREEN, szMsg);
    SetPlayerRandomJailSpawns(playerid);
} else {
    format(szMsg,sizeof(szMsg),"clanwar setted to loc to %s", GetPlayerLocation(playerid));
    format(szMsg,sizeof(szMsg),"clanwar is now active of %s", tmp);
    SendClientMessage(playerid, COLOR_GREEN, szMsg);
    SendClientMessage(playerid, COLOR_GREEN, szMsg);
    SetPlayerRandomJailSpawns(playerid);
}
[/pawn]
The code in the if and else blocks do exactly the same thing. This can easily be condensed, and there's no reason not to. Not only that, but you try to read the variable tmp even when there is nothing in it. This isn't even a situation where you haven't checked to see if there's anything in it. You checked to see if tmp was empty, but even if it was, you ran the exact same code.

Based on the above suggestion as well, replace that entire thing with:

[pawn]
if( strlen( tmp ) )
{
    format(szMsg,sizeof(szMsg),"clanwar setted to loc to %s", GetPlayerLocation(playerid));
    SendClientMessage(playerid, COLOR_GREEN, szMsg);
    format(szMsg,sizeof(szMsg),"clanwar is now active of %s", tmp);
    SendClientMessage(playerid, COLOR_GREEN, szMsg);
    SetPlayerRandomJailSpawns(playerid);
}
[/pawn]



Quote
[pawn]
GetPlayerLocation(playerid)
[/pawn]
This function was never included in your release. The code will not compile without it, making this a broken script. Add it.



Quote
[pawn]
SetPlayerRandomJailSpawns(playerid);
[/pawn]
This line of code will fundamentally break this release. First of all, you never even provided the function, and it is not included in GUPS, which this script is presumably based off of. Therefore, this won't even compile.

Secondly, even if you do include it, then what? How is the script supposed to know how to handle jail spawns? (Whatever that even means -- none of this code was even explained in your post.) Then, what arrays and variables are supposed to keep track of it? Do these jail spawns get reset when players connect and disconnect?

All of that additional code would also have to be added to your post, and chances are, there is even more code in that which would have to be posted, making this better suited for a full script release rather than a snippet that does absolutely nothing.



Quote
[pawn]
SendClientMessage(playerid, COLOR_GREEN, szMsg);
SendClientMessage(playerid, COLOR_GREEN, szMsg);
SendClientMessage(playerid, COLOR_GREEN, szMsg);
SendClientMessage(playerid, COLOR_GREEN, szMsg);
[/pawn]
What is the point of sending the message four times?



XD SEE BUGGS
Yes, I do. In the future, do your bugtesting on a blank GUPS script yourself instead of expecting us to do the work for you. Otherwise, you will lose credibility.
Do not PM me for support.




Offline dynavolt71

  • Crime Boss
  • ****
  • Posts: 371
    • View Profile
    • My Blog
Re: [BROKEN] Easy Clan War System by XD [ME]
« Reply #2 on: April 05, 2013, 08:29:45 am »
Fail Again....
Try Again Later....
[PAWNO]Fix Error " Failed to set data for "" " - http://forum.vicecitymultiplayer.com/index.php?topic=5743.0



:'(

Offline Fire_Head

  • Street Thug
  • *
  • Posts: 35
    • View Profile
Re: [BROKEN] Easy Clan War System by XD [ME]
« Reply #3 on: April 05, 2013, 11:24:54 am »
yes Its Not woRk
Try again

Offline AhMeD_R@Z@

  • Street Thug
  • *
  • Posts: 6
    • View Profile
Re: [BROKEN] Easy Clan War System by XD [ME]
« Reply #4 on: June 12, 2013, 09:56:48 pm »

Yes Try Again Please

Offline JaVeD

  • Street Thug
  • *
  • Posts: 46
  • Want scripts? Pm me now! Just for $
    • View Profile
    • Free Host -> Clicky
Re: [BROKEN] Easy Clan War System by XD [ME]
« Reply #5 on: June 16, 2013, 04:23:46 pm »
Any time the script by mrox worked ? so how this work :P
SA:MP Server: 5.231.49.21:7777
Website: www.nse-server.com