Command help.
#1

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.
Reply
#2

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;
  }
Reply
#3

What is with this?
Reply
#4

It should fix it for you..
Reply
#5

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

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

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.
Reply
#8

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)