[HELP] What is wrong with this command?
#1

When im in car and i do "/italian hey", it doesnt show any message... But it does when im not in vehicle, whats the problem?
pawn Код:
if(strcmp(cmd, "/ita", true) == 0 || strcmp(cmd, "/italian", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        if(gPlayerLogged[playerid] == 0)
        {
          SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
          return 1;
        }
        if(PlayerInfo[playerid][pLeader] == 9 || PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 11 || PlayerInfo[playerid][pMember] == 11)
        {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                new length = strlen(cmdtext);
                while ((idx < length) && (cmdtext[idx] <= ' '))
                {
                    idx++;
                }
                new offset = idx;
                new result[128];
                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: /ita(lian) [chat]");
                    return 1;
                }
                new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
                new Float:x, Float:y, Float:z;
            GetPlayerPos(playerid,x,y,z);
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    {
                      if(PlayerToPoint(20, i, x, y, z))
                      {
                            if(PlayerInfo[i][pMember] == 9 || PlayerInfo[i][pLeader] == 9 || PlayerInfo[playerid][pLeader] == 11 || PlayerInfo[playerid][pMember] == 11)
                            {
                                if(!IsPlayerInAnyVehicle(playerid))
                                {
                                    if(PlayerInfo[playerid][pMaskuse] == 1)
                                    {
                                        format(string, sizeof(string), "Masked Stranger: [Italian] %s", result);
                                        ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                                    }
                                    else
                                  {
                                    format(string, sizeof(string), "%s: [Italian] %s", sendername, result);
                                    ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                                    }
                                }
                                else
                                {
                                if(pveh == 424 || pveh == 429 || pveh == 430 || pveh == 432 || pveh == 439 || pveh == 446
                                  || pveh == 448 || pveh == 449 || pveh == 452 || pveh == 453 || pveh == 454 || pveh == 457
                                  || pveh == 461 || pveh == 462 || pveh == 463 || pveh == 468 || pveh == 471 || pveh == 472
                                  || pveh == 473 || pveh == 480 || pveh == 481 || pveh == 484 || pveh == 485 || pveh == 486
                                  || pveh == 493 || pveh == 500 || pveh == 502 || pveh == 503 || pveh == 504 || pveh == 506
                                  || pveh == 509 || pveh == 510 || pveh == 521 || pveh == 522 || pveh == 523 || pveh == 530
                                  || pveh == 531 || pveh == 533 || pveh == 536 || pveh == 539 || pveh == 555 || pveh == 567
                                  || pveh == 568 || pveh == 571 || pveh == 572 || pveh == 574 || pveh == 595
                                  || pveh == 575 || pveh == 581 || pveh == 586 || pveh == 594)
                                {
                                    if(VehicleWindows[GetPlayerVehicleID(playerid)] == 0)
                                    {
                                        if(PlayerInfo[playerid][pMaskuse] == 1)
                                            {
                                                format(string, sizeof(string), "Masked Stranger: [Italian][Windows Shut] %s", result);
                                                ProxDetector(10.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                                            }
                                            else
                                            {
                                              GetPlayerName(playerid, sendername, sizeof(sendername));
                                            format(string, sizeof(string), "%s: [Italian][Windows Shut] %s", sendername, result);
                                            ProxDetector(10.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                                            }
                                        }
                                        else
                                        {
                                        if(PlayerInfo[playerid][pMaskuse] == 1)
                                            {
                                                format(string, sizeof(string), "Masked Stranger: [Italian][Windows Open] %s", result);
                                                ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                                            }
                                            else
                                            {
                                              GetPlayerName(playerid, sendername, sizeof(sendername));
                                            format(string, sizeof(string), "%s: [Italian][Windows Open] %s", sendername, result);
                                            ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, " You can't talk Italian!");
            }
      }
      return 1;
    }
Reply
#2

Help?
Reply
#3

Maybe you should compile it and send us what the compile writes.

And I think you should put

Код:
at if logged 0
return SendClientMessage(etc)
Reply
#4

There are no errors, just that it wont' work if he's on foot, re-read the post
Reply
#5

Quote:
Originally Posted by Swift_
There are no errors, just that it wont' work if he's on foot, re-read the post
Yeah
Reply
#6

Anyone?
Reply
#7

Wtf all that code just to send a message ?

I refuse to help people which use PEN/GF scripts because they are a plague, seriously that is really crappy code and I would suggest creating your own script from scratch.
Reply
#8

Quote:
Originally Posted by Donny
Wtf all that code just to send a message ?

I refuse to help people which use PEN/GF scripts because they are a plague, seriously that is really crappy code and I would suggest creating your own script from scratch.
Its not just single message, read the code and you understand.

And why to create my own if this allready exist and btw i edited that command like 70%.

Dont post then if you refuse to help me. Who cares what you refuse or not.

+i need this command to work, to finish my whole InGame Language system. That is 100% made by me with my own hands, exept this command.
Reply
#9

Sir yes sir
Reply


Forum Jump:


Users browsing this thread: