SA-MP Forums Archive
Command help. - 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: Command help. (/showthread.php?tid=225249)



Command help. - GaB1TzZzu - 13.02.2011

pawn Код:
if(strcmp(cmd, "/changeplate", true) == 0)
#pragma tabsize 0
    {
      if(PlayerInfo[playerid][pMember] == 1 && PlayerInfo[playerid][pRank] >= 5)
      {
        cmd = strtok(cmdtext, idx);
        if(!strlen(cmd))
        {
            SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /changeplate [platenumber (up to 8 chars, use '-' for space char)]");
            return 1;
        }
                if(IsPlayerInAnyVehicle(playerid) == 1)
                {
                    new amount;
                    amount = strlen(cmd);
                    SetVehicleNumberPlate(GetPlayerVehicleID(playerid), cmd);
                    new id = GetVecInfoID( vehicleid );
                    VehicleInfo[ id ][ vPlate ] = amount;
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, 0xFF9900AA, "SERVER: Nu esti in nicio masina.");
                }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD2, "SERVER: Nu ai autorizatie pentru a folosi aceasta comanda [PD rank5+].");
        }
      return 1;
  }
And my problem is this VehicleInfo[ id ][ vPlate ] = amount; .. if i do /changeplate TEST , i will not have on vPlate -> "test" .. i will have just " " [blank] .. Please help me.



Re: Command help. - Luis- - 13.02.2011

pawn Код:
if(strcmp(cmd, "/changeplate", true) == 0)
#pragma tabsize 0
    {
      if(PlayerInfo[playerid][pMember] == 1 && PlayerInfo[playerid][pRank] >= 5)
      {
        cmd = strtok(cmdtext, idx);
        if(!strlen(cmd))
        {
            SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /changeplate [platenumber (up to 8 chars, use '-' for space char)]");
            return 1;
        }
                if(IsPlayerInAnyVehicle(playerid) == 1)
                {
                    new amount;
                    amount = strlen(cmd);
                  SetVehicleNumberPlate(GetPlayerVehicleID(playerid), cmd);
                    SetVehicleToRespawn(GetPlayerVehicleID(playerid));
                    new id = GetVecInfoID( vehicleid );
                    VehicleInfo[ id ][ vPlate ] = amount;
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, 0xFF9900AA, "SERVER: Nu esti in nicio masina.");
                }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD2, "SERVER: Nu ai autorizatie pentru a folosi aceasta comanda [PD rank5+].");
        }
      return 1;
  }



Re: Command help. - GaB1TzZzu - 13.02.2011

What is with this?


Re: Command help. - Luis- - 13.02.2011

It should fix it for you..


Re: Command help. - GaB1TzZzu - 13.02.2011

I didn't see any changes.. i`ll try it now.


Re: Command help. - GaB1TzZzu - 13.02.2011

Nope, it doesn't work.. I have just in game that plate, but i don't have it on VehicleInfo[ id ][ vPlate ] ..


Re: Command help. - Luis- - 13.02.2011

pawn Код:
if(strcmp(cmd, "/changeplate", true) == 0)
#pragma tabsize 0
    {
      if(PlayerInfo[playerid][pMember] == 1 && PlayerInfo[playerid][pRank] >= 5)
      {
        cmd = strtok(cmdtext, idx);
        if(!strlen(cmd))
        {
            SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /changeplate [platenumber (up to 8 chars, use '-' for space char)]");
            return 1;
        }
                if(IsPlayerInAnyVehicle(playerid) == 1)
                {
                    //new amount;
                    //amount = strlen(cmd);
                  SetVehicleNumberPlate(GetPlayerVehicleID(playerid), cmd);
                    SetVehicleToRespawn(GetPlayerVehicleID(playerid));
                    new id = GetVecInfoID( vehicleid );
                    VehicleInfo[ id ][ vPlate ] = cmd;
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, 0xFF9900AA, "SERVER: Nu esti in nicio masina.");
                }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD2, "SERVER: Nu ai autorizatie pentru a folosi aceasta comanda [PD rank5+].");
        }
      return 1;
  }
Try that, I don't know if it will fix it.


Re: Command help. - GaB1TzZzu - 13.02.2011

I tried, it doesn't work ..
error 006: must be assigned to an array


Re: Command help. - SkizzoTrick - 13.02.2011

Yea,i have that system too
But mine vPlate is setted to 0 after restart


Re: Command help. - Luis- - 13.02.2011

pawn Код:
if(strcmp(cmd, "/changeplate", true) == 0)
#pragma tabsize 0
    {
      if(PlayerInfo[playerid][pMember] == 1 && PlayerInfo[playerid][pRank] >= 5)
      {
        cmd = strtok(cmdtext, idx);
        if(!strlen(cmd))
        {
            SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /changeplate [platenumber (up to 8 chars, use '-' for space char)]");
            return 1;
        }
                if(IsPlayerInAnyVehicle(playerid) == 1)
                {
                    //new amount;
                    //amount = strlen(cmd);
                  SetVehicleNumberPlate(GetPlayerVehicleID(playerid), cmd);
                    SetVehicleToRespawn(GetPlayerVehicleID(playerid));
                    new id = GetVecInfoID( vehicleid );
                    VehicleInfo[ id ][ vPlate ] = cmd[0];
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, 0xFF9900AA, "SERVER: Nu esti in nicio masina.");
                }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD2, "SERVER: Nu ai autorizatie pentru a folosi aceasta comanda [PD rank5+].");
        }
      return 1;
  }