SA-MP Forums Archive
Command work but doesn't update. - 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)
+--- Thread: Command work but doesn't update. (/showthread.php?tid=638355)



Command work but doesn't update. - MrAjusshi - 30.07.2017

When I set one vehicle to different job it just didn't work even though the command work. The vehicle itself didn't update and still same and remains as civillian vehicle not some job (example like trucker job vehicle only).

Код:
  else if(!strcmp(tmp, "job", true, 3))
  {
      if(!IsPlayerInAnyVehicle(playerid)) return SendClientError(playerid, "You are not in any vehicle!");
      if(GetAdminLevel(playerid) < 10) return SendClientError(playerid, CANT_USE_CMD);
    if(!strlen(tmp2) || IsNumeric(tmp2) || strlen(tmp2) > MAX_PLAYER_NAME) return SCP(playerid, "job [name]");
    dini_Set(CarFile(GetPlayerVehicleID(playerid)), "jobname", tmp2);
    SendClientInfo(playerid, "Success: The job has been updated to this vehicle.");
    myStrcpy(Vehicles[GetPlayerVehicleID(playerid)][jobname], tmp2);
  }



Re: Command work but doesn't update. - Shinja - 30.07.2017

Which part doesnt work, dini_Set or myStrcpy?


Re: Command work but doesn't update. - MrAjusshi - 30.07.2017

dini set


Re: Command work but doesn't update. - mongi - 30.07.2017

CarFile codes ?


Re: Command work but doesn't update. - CombatZombie - 30.07.2017

Код:
else if(!strcmp(tmp, "job", true, 3))
  {
      if(!IsPlayerInAnyVehicle(playerid)) return SendClientError(playerid, "You are not in any vehicle!");
      if(GetAdminLevel(playerid) < 10) return SendClientError(playerid, CANT_USE_CMD);
    if(!strlen(tmp2) || IsNumeric(tmp2) || strlen(tmp2) > MAX_PLAYER_NAME) return SCP(playerid, "job [name]");
    dini_IntSet(CarFile(GetPlayerVehicleID(playerid)), "jobname", tmp2);
    SendClientInfo(playerid, "Success: The job has been updated to this vehicle.");
    myStrcpy(Vehicles[GetPlayerVehicleID(playerid)][jobname], tmp2);
  }



Re: Command work but doesn't update. - mongi - 30.07.2017

You have a function called CarFile which i asked for it's codes. Not the cmd (that u already posted)


Re: Command work but doesn't update. - MrAjusshi - 30.07.2017

Quote:
Originally Posted by mongi
Посмотреть сообщение
You have a function called CarFile which i asked for it's codes. Not the cmd (that u already posted)
It's not me who replied before. Anyway, fixed.


Re: Command work but doesn't update. - Shinja - 30.07.2017

Show your CarFile function, and go manually to scriptfiles and check if there is a file created "CarFile(GetPlayerVehicleID(playerid)", if its created check if the line "jobname" is set or not.